flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > E820 Map |
Author |
|
TightCoderEx 20 Jul 2013, 16:57
Purpose is to build a map at the top of first 64K (1000H), decending order, growing downward and each entry 32 bytes. Padding is for easy visualization in Bochs and less complexity moving segment to next iteration, or back.
Code: mov ax, es dec ax dec ax mov es, ax ; Bump segment back 32 bytes Code: push es add word [esp], 2 pop es Due to lack of any comprehensive documention, I fashioned my algo somewhat after this wiki example and Pure64 code. Out of curiosity sake, does anyone have the answers to the following; 1: Why does EDX need "SMAP", when it should be obvious what is required by calling routine with E820 in EAX. 2. You would think the callee be designed in such a way that if EAX <> EDX or EBX = 0 on first interation, CF would be set and if so EAX would have an error code. Code: call GetMapEntry jc .Error cmp eax, edx ; Was magic returned in EAX? jnz .Error test ebx, ebx jnz @F Similarly this. Of what value is an entry that doesn't have a size. You would think startup probing memory would eliminate this possibility. Code: @@: mov eax, [es:8] or eax, [es:12] ; ZF=1 if entry has null length jz .Skip Two more functions and then I can get into protected or long mode and put this BIOS crap behind me.
|
|||||||||||
20 Jul 2013, 16:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.