|
|
@ -1,19 +1,19 @@ |
|
|
|
; SRs to find memory size and leave it as a "note" for the kernel |
|
|
|
; SRs to find memory size and leave it as a "note" for the kernel |
|
|
|
|
|
|
|
|
|
|
|
mmap_probe: ; literally just test the memory boundaries |
|
|
|
; mmap_probe: ; literally just test the memory boundaries |
|
|
|
push eax |
|
|
|
; push eax |
|
|
|
push ebx |
|
|
|
; push ebx |
|
|
|
push edx |
|
|
|
; push edx |
|
|
|
push ebp |
|
|
|
; push ebp |
|
|
|
|
|
|
|
; |
|
|
|
mov ebp, esi |
|
|
|
; mov ebp, esi |
|
|
|
add esi, 0x00000ff |
|
|
|
; add esi, 0x00000ff |
|
|
|
and esi, ~0x00000ff |
|
|
|
; and esi, ~0x00000ff |
|
|
|
mmap_probe_addr: |
|
|
|
; mmap_probe_addr: |
|
|
|
|
|
|
|
; |
|
|
|
mmap_probe_done: |
|
|
|
; mmap_probe_done: |
|
|
|
|
|
|
|
|
|
|
|
mmap_e820: |
|
|
|
e820: |
|
|
|
mov di, 0x8004 |
|
|
|
mov di, 0x8004 |
|
|
|
mov ebx, 0 ; Must be 0 |
|
|
|
mov ebx, 0 ; Must be 0 |
|
|
|
mov bp, 0 ; entry count |
|
|
|
mov bp, 0 ; entry count |
|
|
@ -27,15 +27,17 @@ mmap_e820: |
|
|
|
int 0x15 ; Do the interupt |
|
|
|
int 0x15 ; Do the interupt |
|
|
|
|
|
|
|
|
|
|
|
; carry flag = (un)supported function |
|
|
|
; carry flag = (un)supported function |
|
|
|
jc mmap_e820_fail ; Try probing instead |
|
|
|
jc e820_fail ; Try probing instead |
|
|
|
|
|
|
|
|
|
|
|
cmp eax, edx ; eax should be = 'SMAP' |
|
|
|
cmp eax, edx ; eax should be = 'SMAP' |
|
|
|
jne mmap_e820_fail ; if not then fail |
|
|
|
jne e820_fail ; if not then fail |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test ebx, ebx ; no entries |
|
|
|
|
|
|
|
je e820_fail |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test ebx, ebx |
|
|
|
|
|
|
|
je mmap_e820_fail |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mmap_e820_fail: |
|
|
|
e820_fail: |
|
|
|
stc |
|
|
|
stc |
|
|
|
ret |
|
|
|
ret |
|
|
|
|
|
|
|
|
|
|
|