]>
wirehaze git hosting - BOS.git/blob - kernel/init/bios.asm
1 ;----------------------------------------------------------;
2 ; BOS kernel Christoffer Bubach, 2003-2005. ;
3 ;----------------------------------------------------------;
5 ; Goes back to realmode to do an INT. ;
7 ;----------------------------------------------------------;
13 shr eax, 16 ; move high bits to ax
14 mov word [realmode_ax
], ax ; save new ax value
18 shr ebx, 16 ; move high bits to bx
19 mov byte [int_number
], bl ; save int number to call
22 mov byte [realmode_error
], 0 ; all variables is in the
23 mov word [realmode_bx
], bx ; realmode/variables.inc file
24 mov word [realmode_cx
], cx
25 mov word [realmode_dx
], dx
27 jmp pword 0x18:do_16pmode
; must substract 0x10000 from
28 ; data addresses becasue of
29 ; fasm strict "org" behavior
56 lidt [ridtr
] ; realmode/variables.inc
59 mov ax, word [realmode_ax
]
60 mov bx, word [realmode_bx
]
61 mov cx, word [realmode_cx
]
62 mov dx, word [realmode_dx
]
64 push ax ; this is some cool shit.. ;)
65 mov al, [int_number
] ; interrupt to preform
66 mov [$+5], al ; move it to right pos.
68 db 0xCD ; opcode for int.
69 db 0x00 ; move int_number here
72 mov byte [realmode_error
], 1
75 mov word [realmode_ax
], ax
76 mov word [realmode_bx
], bx
77 mov word [realmode_cx
], cx
78 mov word [realmode_dx
], dx
88 jmp pword 0x08:gobackto_pm
93 mov ax, 0x10 ; refresh all segment registers
103 cmp [realmode_error
], 1 ; if error, then