📄 startupwithbios.s
字号:
; File: startup.s
; Declare the main function.
.global main
.section .text
.global _start
_start:
; Jump the main function.
; jmp main
; Replace TMR0 ISR with tmr0_isr
mov [0], tmr0_isr
; Enable TMR0 INT
or [0xC00e], 0x0001
; Replace IDLER ISR with main. Now BIOS IDLE chain is only called in our TMR0 ISR.
mov [(71*2)],main
ret
; int 70 enables the IDLE_INT. This allows bios to execute periodically
; since main never returns. Now we can use debug USB port and UART.
tmr0_isr: ; TMR0 ISR, now calls BIOS IDLE
push [0xc000] ; Push Flags Register
int 73 ; PUSHALL_INT
int 70 ; IDLE_INT (will check UART and USB for Scan signitures)
int 74 ; POPALL_INT
mov [0xc010], 10000 ; Load TMR0 so that it will expire every 10ms
pop [0xc000] ; Pop Flags Register
sti
ret
; End of file: startup.s
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -