Created
April 2, 2013 18:04
-
-
Save agesome/5294606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.globl go_realmode | |
.org 0 | |
ivt: | |
.skip 1024, 0 | |
ivt_ptr: | |
.hword 1023 | |
.int ivt | |
go_realmode: | |
cli | |
mov $0x10, %eax /* 16-bit code descriptor in GDT */ | |
mov %eax, %ds | |
mov %eax, %es | |
mov %eax, %fs | |
mov %eax, %gs | |
mov %eax, %ss | |
mov %cr0, %eax | |
and $0x7FFFFFFe, %eax | |
mov %eax, %cr0 | |
ljmp $0, $realmode | |
realmode: | |
mov $0, %ax | |
mov %ax, %ds | |
mov %ax, %es | |
mov %ax, %fs | |
mov %ax, %gs | |
lidt ivt_ptr | |
sti | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment