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-05-13 00:09:36 +02:00
|
|
|
mov r0, BACKGROUND_COLOR
|
|
|
|
call fill_background
|
2022-10-28 07:42:56 +02:00
|
|
|
|
2022-05-13 00:09:36 +02:00
|
|
|
mov r0, boot_str
|
|
|
|
mov r1, 16
|
|
|
|
mov r2, 464
|
|
|
|
mov r3, TEXT_COLOR
|
|
|
|
mov r4, 0x00000000
|
|
|
|
mov r10, FOX32ROM_VERSION_MAJOR
|
|
|
|
mov r11, FOX32ROM_VERSION_MINOR
|
|
|
|
mov r12, FOX32ROM_VERSION_PATCH
|
|
|
|
call draw_format_str_to_background
|
|
|
|
|
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
|
|
|
|
|
|
|
|
; disable the menu bar
|
2022-03-23 19:24:01 +01:00
|
|
|
call disable_menu_bar
|
2022-01-31 12:37:49 +01:00
|
|
|
|
2022-04-17 23:38:38 +02:00
|
|
|
ret
|