Skip to content

Instantly share code, notes, and snippets.

@heatd
Created May 24, 2022 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heatd/16be0f9ce2dba386cf86e557ba0a6efa to your computer and use it in GitHub Desktop.
Save heatd/16be0f9ce2dba386cf86e557ba0a6efa to your computer and use it in GitHub Desktop.
.section .reset16,"ax"
.code16
reset_vector2:
ljmpw $0xf000, $1f
1:
lgdtl %cs:gdtr
mov %cr0, %eax
or $1, %al
mov %eax, %cr0
ljmpl $0x8, $SecEntry
gdtr:
.word 40
.long gdt
.section .reset_vector,"ax"
.code16
.global reset_vector
reset_vector:
jmp . - 0xff0
.rept 13
nop
.endr
.section .text
SecEntry:
cli
hlt
.section .rodata
gdt:
.quad 0x0000000000000000
.quad 0x00CF9A000000FFFF
.quad 0x00CF92000000FFFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment