]>
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
; begin our dark journey into 16bit-land
43 jmp 0x0000:(do_realm
) ; this should be triple checked!
55 lidt [ridtr
] ; realmode/variables.inc
58 mov ax, word [realmode_ax
]
59 mov bx, word [realmode_bx
]
60 mov cx, word [realmode_cx
]
61 mov dx, word [realmode_dx
]
63 push ax ; this is some cool shit.. ;)
64 mov al, [int_number
] ; interrupt to preform
65 mov [$+5], al ; move it to right pos.
67 db 0xCD ; opcode for int.
68 db 0x00 ; move int_number here
71 mov byte [realmode_error
], 1
74 mov word [realmode_ax
], ax
75 mov word [realmode_bx
], bx
76 mov word [realmode_cx
], cx
77 mov word [realmode_dx
], dx
87 jmp pword 0x08:gobackto_pm
92 mov ax, 0x10 ; refresh all segment registers
102 cmp [realmode_error
], 1 ; if error, then