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