Reformat for 8-width tabs
This commit is contained in:
@@ -51,7 +51,7 @@ bootstrap_gdt_ptr:
|
|||||||
LONG MODE BOOTSTRAP PAGING STRUCTURES
|
LONG MODE BOOTSTRAP PAGING STRUCTURES
|
||||||
*******/
|
*******/
|
||||||
.section .boot.bss, "aw", @nobits
|
.section .boot.bss, "aw", @nobits
|
||||||
bootstrap_pml4t: # a single PML4T
|
bootstrap_pml4t: # a single PML4T
|
||||||
.skip 0x1000
|
.skip 0x1000
|
||||||
bootstrap_pdpt: # a single PDPT
|
bootstrap_pdpt: # a single PDPT
|
||||||
.skip 0x1000
|
.skip 0x1000
|
||||||
@@ -197,7 +197,7 @@ init_page_tables:
|
|||||||
add $0x1000, %edi
|
add $0x1000, %edi
|
||||||
sub %ecx, %edi
|
sub %ecx, %edi
|
||||||
sub $0x08, %edi # subtract one from the index here, otherwise the mapping will be at 0xffffffffc0000000
|
sub $0x08, %edi # subtract one from the index here, otherwise the mapping will be at 0xffffffffc0000000
|
||||||
# (each entry in the array is 8 bytes long)
|
# (each entry in the array is 8 bytes long)
|
||||||
|
|
||||||
/* %ESI is a pointer into the pagedir buffer.
|
/* %ESI is a pointer into the pagedir buffer.
|
||||||
%EDI is a pointer into the PDPT.
|
%EDI is a pointer into the PDPT.
|
||||||
@@ -290,17 +290,17 @@ long_mode_switch:
|
|||||||
_start:
|
_start:
|
||||||
mov $bootstrap_stack_top, %esp
|
mov $bootstrap_stack_top, %esp
|
||||||
|
|
||||||
push %ebx # store the pointer to the multiboot info block.
|
push %ebx # store the pointer to the multiboot info block.
|
||||||
|
|
||||||
# check if long mode is supported
|
# check if long mode is supported
|
||||||
movl $0x80000000, %eax # Extended-function 80000000h.
|
movl $0x80000000, %eax # Extended-function 80000000h.
|
||||||
cpuid # Is largest extended function
|
cpuid # Is largest extended function
|
||||||
cmpl $0x80000000, %eax # any function > 80000000h?
|
cmpl $0x80000000, %eax # any function > 80000000h?
|
||||||
jbe no_long_mode # If not, no long mode.
|
jbe no_long_mode # If not, no long mode.
|
||||||
movl $0x80000001, %eax # Extended-function 80000001h.
|
movl $0x80000001, %eax # Extended-function 80000001h.
|
||||||
cpuid # Now EDX = extended-features flags.
|
cpuid # Now EDX = extended-features flags.
|
||||||
btl $29, %edx # Test if long mode is supported.
|
btl $29, %edx # Test if long mode is supported.
|
||||||
jnc no_long_mode # Exit if not supported.
|
jnc no_long_mode # Exit if not supported.
|
||||||
|
|
||||||
movl $1, %eax
|
movl $1, %eax
|
||||||
cpuid
|
cpuid
|
||||||
@@ -312,7 +312,7 @@ _start:
|
|||||||
movb $0xF, (%eax)
|
movb $0xF, (%eax)
|
||||||
|
|
||||||
call init_page_tables
|
call init_page_tables
|
||||||
call long_mode_switch # calls start_64, does not return
|
call long_mode_switch # calls start_64, does not return
|
||||||
|
|
||||||
cli
|
cli
|
||||||
hlt
|
hlt
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
ERROR MESSAGE STRINGS
|
ERROR MESSAGE STRINGS
|
||||||
*******/
|
*******/
|
||||||
kernel_identifier:
|
kernel_identifier:
|
||||||
.asciz " Socks kernel version " BUILD_ID " "
|
.asciz " Socks kernel version " BUILD_ID " "
|
||||||
|
|
||||||
|
|
||||||
.section .boot.text, "ax", @progbits
|
.section .boot.text, "ax", @progbits
|
||||||
@@ -29,7 +29,7 @@ print_kernel_identifier:
|
|||||||
|
|
||||||
2:
|
2:
|
||||||
movsb
|
movsb
|
||||||
movb $0x70, (%rdi) # black text on white background
|
movb $0x70, (%rdi) # black text on white background
|
||||||
inc %rdi
|
inc %rdi
|
||||||
cmpb $0, (%rsi)
|
cmpb $0, (%rsi)
|
||||||
jne 2b
|
jne 2b
|
||||||
|
|||||||
Reference in New Issue
Block a user