More coherent symbol names
This commit is contained in:
parent
517fcba43b
commit
c41288151a
1 changed files with 20 additions and 20 deletions
40
lboot.S
40
lboot.S
|
|
@ -27,11 +27,11 @@ _start: cli
|
||||||
|
|
||||||
mov $msg_getmap, %si
|
mov $msg_getmap, %si
|
||||||
call print
|
call print
|
||||||
call getmap
|
call get_map
|
||||||
|
|
||||||
mov $msg_mkheap, %si
|
mov $msg_mkheap, %si
|
||||||
call print
|
call print
|
||||||
call makeheap
|
call make_heap
|
||||||
|
|
||||||
mov $msg_paging, %si
|
mov $msg_paging, %si
|
||||||
call print
|
call print
|
||||||
|
|
@ -71,34 +71,34 @@ unreal: push %ds
|
||||||
mov %cr0, %eax
|
mov %cr0, %eax
|
||||||
or $0x01, %al
|
or $0x01, %al
|
||||||
mov %eax, %cr0
|
mov %eax, %cr0
|
||||||
ljmp $0x8, $_prot
|
ljmp $0x8, $_urprot
|
||||||
|
|
||||||
_prot: mov $0x10, %cx
|
_urprot: mov $0x10, %cx
|
||||||
mov %cx, %ds
|
mov %cx, %ds
|
||||||
|
|
||||||
and $0xFE, %al
|
and $0xFE, %al
|
||||||
mov %eax, %cr0
|
mov %eax, %cr0
|
||||||
ljmp $0x0, $_unreal
|
ljmp $0x0, $_urunreal
|
||||||
|
|
||||||
_unreal: pop %ds
|
_urunreal: pop %ds
|
||||||
ret
|
ret
|
||||||
|
|
||||||
// getmap: Retrieve memory map using e820 BIOS function
|
// get_map: Retrieve memory map using e820 BIOS function
|
||||||
getmap: mov %ds, %ax
|
get_map: mov %ds, %ax
|
||||||
mov %ax, %es
|
mov %ax, %es
|
||||||
mov $memmap, %di
|
mov $memmap, %di
|
||||||
xor %ebx, %ebx
|
xor %ebx, %ebx
|
||||||
mov $0x534D4150, %edx // e820 magic number
|
mov $0x534D4150, %edx // e820 magic number
|
||||||
_nextmap: movl $0, 20(%di)
|
_gmnext: movl $0, 20(%di)
|
||||||
mov $24, %ecx
|
mov $24, %ecx
|
||||||
mov $0xE820, %eax
|
mov $0xE820, %eax
|
||||||
int $0x15
|
int $0x15
|
||||||
jc _endmap
|
jc _gmdone
|
||||||
test %ebx, %ebx
|
test %ebx, %ebx
|
||||||
jz _endmap
|
jz _gmdone
|
||||||
add $24, %di
|
add $24, %di
|
||||||
jmp _nextmap
|
jmp _gmnext
|
||||||
_endmap: add $24, %di
|
_gmdone: add $24, %di
|
||||||
mov %di, memmap_end
|
mov %di, memmap_end
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -132,8 +132,8 @@ _pgnext: mov %ecx, %eax
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
// makeheap: find a memory range suitable for heap usage
|
// make_heap: find a memory range suitable for heap usage
|
||||||
makeheap: mov $memmap-24, %si
|
make_heap: mov $memmap-24, %si
|
||||||
_mhnext: add $24, %si
|
_mhnext: add $24, %si
|
||||||
cmp memmap_end, %si
|
cmp memmap_end, %si
|
||||||
jae _mhdone
|
jae _mhdone
|
||||||
|
|
@ -193,23 +193,23 @@ _aerr: mov $msg_aerr, %si
|
||||||
// print: print NUL-terminated string pointed to by SI
|
// print: print NUL-terminated string pointed to by SI
|
||||||
print: xor %bx, %bx
|
print: xor %bx, %bx
|
||||||
|
|
||||||
_nextchr: mov $COM1+5, %dx
|
_prnext: mov $COM1+5, %dx
|
||||||
inb %dx, %al
|
inb %dx, %al
|
||||||
test $0x20, %al
|
test $0x20, %al
|
||||||
jz _nextchr
|
jz _prnext
|
||||||
|
|
||||||
lodsb
|
lodsb
|
||||||
or %al, %al
|
or %al, %al
|
||||||
jz _endprint
|
jz _prdone
|
||||||
|
|
||||||
mov $COM1, %dx
|
mov $COM1, %dx
|
||||||
outb %al, %dx
|
outb %al, %dx
|
||||||
|
|
||||||
mov $0x0E, %ah
|
mov $0x0E, %ah
|
||||||
int $0x10
|
int $0x10
|
||||||
jmp _nextchr
|
jmp _prnext
|
||||||
|
|
||||||
_endprint: ret
|
_prdone: ret
|
||||||
|
|
||||||
// gdt: Protected mode / Unreal mode 16-bit GDT
|
// gdt: Protected mode / Unreal mode 16-bit GDT
|
||||||
gdt: // entry 0: null descriptor
|
gdt: // entry 0: null descriptor
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue