Replace bios with bootloader, don't use bootsector
Instead of using the bootsector to load a bootloader, just put the bootloader in the ROM and call it a day. It looks for a file on the SD card in the root directory named `kernel.bin` and loads it into memory. This is not a perfect solution, as the kernel will grow larger and the kernel load address will have to change. At this point I could add back the bootloader, but that is for later. Also the bootloader is just a copy of the kernel, so that can be trimmed down a lot.
This commit is contained in:
36
sw/bootloader/devices/uart.s
Normal file
36
sw/bootloader/devices/uart.s
Normal file
@@ -0,0 +1,36 @@
|
||||
.include "io.inc65"
|
||||
|
||||
.importzp sp, sreg
|
||||
|
||||
.export _uart_txb, _uart_txb_block
|
||||
.export _uart_rxb
|
||||
.export _uart_status
|
||||
|
||||
.autoimport on
|
||||
|
||||
.code
|
||||
|
||||
; @in A: byte to transmit
|
||||
; Transmits a byte over the UART
|
||||
_uart_txb:
|
||||
sta UART_TXB ; Just write value, don't wait
|
||||
rts
|
||||
|
||||
_uart_txb_block:
|
||||
pha
|
||||
sta UART_TXB ; Write value
|
||||
@1: lda UART_STATUS ; Wait for status[0] to be 0
|
||||
bit #$01
|
||||
bne @1
|
||||
pla
|
||||
rts
|
||||
|
||||
_uart_rxb:
|
||||
lda UART_RXB ; Read value
|
||||
ldx #$00
|
||||
rts
|
||||
|
||||
_uart_status:
|
||||
lda UART_STATUS
|
||||
ldx #$00
|
||||
rts
|
||||
Reference in New Issue
Block a user