2022-01-31 12:37:49 +01:00
|
|
|
; disk booting routines
|
|
|
|
; these are only used during booting, they are not exposed via the jump table
|
|
|
|
|
2022-10-28 07:42:56 +02:00
|
|
|
; load the boot sector of disk 0 to 0x00000800 and jump to it
|
2022-01-31 12:37:49 +01:00
|
|
|
; inputs:
|
2022-10-28 07:42:56 +02:00
|
|
|
; none
|
2022-01-31 12:37:49 +01:00
|
|
|
; outputs:
|
|
|
|
; none (doesn't return)
|
|
|
|
start_boot_process:
|
2022-10-28 07:42:56 +02:00
|
|
|
mov r0, 0x80003000 ; command to read a sector from disk 0 into memory
|
|
|
|
mov r1, 0x80002000 ; command to set the location of the buffer
|
2022-01-31 12:37:49 +01:00
|
|
|
|
2022-10-28 07:42:56 +02:00
|
|
|
; read sector 0 to 0x800
|
|
|
|
out r1, 0x00000800
|
|
|
|
out r0, 0
|
2022-04-17 23:38:38 +02:00
|
|
|
|
2022-01-31 12:37:49 +01:00
|
|
|
; now clean up and jump to the loaded binary
|
|
|
|
call boot_cleanup
|
|
|
|
jmp 0x00000800
|
|
|
|
|
|
|
|
; clean up the system's state before jumping to the loaded binary
|
|
|
|
; inputs:
|
|
|
|
; none
|
|
|
|
; outputs:
|
|
|
|
; none
|
|
|
|
boot_cleanup:
|
|
|
|
; clear the background
|
2022-02-23 19:51:36 +01:00
|
|
|
mov r0, BACKGROUND_COLOR
|
2022-01-31 12:37:49 +01:00
|
|
|
call fill_background
|
|
|
|
|
2022-04-17 23:38:38 +02:00
|
|
|
ret
|