flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Flat Real Mode GDT question |
Author |
|
vid 03 Jul 2005, 21:00
look for some "protected mode description" or "protected mode introduction" or something like that.
|
|||
03 Jul 2005, 21:00 |
|
Tomasz Grysztar 04 Jul 2005, 09:49
The source you've quoted doesn't compile with fasm, because it uses NASM's operators << and |, for fasm you should use "shl" and "or" operators.
As for the GDT, it is needed to set up the segment descriptors with 4 GB limit (in this thread you've got more info on FRM: http://board.flatassembler.net/topic.php?t=135 but I guess you've already found it). Last edited by Tomasz Grysztar on 10 Oct 2005, 21:04; edited 1 time in total |
|||
04 Jul 2005, 09:49 |
|
adefeo 04 Jul 2005, 13:09
Ok, 2 more questions:
1. How can I test that FRM is enabled correctly? 2. Do I need to enable the A20 gate to access the full 4GB flat address space? |
|||
04 Jul 2005, 13:09 |
|
Tomasz Grysztar 04 Jul 2005, 13:14
1. If you try to access offset above 0FFFFh when no FRM is enabled, you will get exception (interrupt) 13. As you can read in the thread I linked to, I used this to enable FRM only when it's not enabled, since I put the FRM initialization routine inside the interrupt 13 handler.
2. Yes, otherwise the addresses above 1 MB will "wrap" and you will access the memory in first megabyte anyway. |
|||
04 Jul 2005, 13:14 |
|
adefeo 04 Jul 2005, 13:38
One more question that I just thought of:
Do I still address memory via the segment:offset pair (ex, can I still do a "JMP 0x2000:0x0000", or do I not use segments, since it is "flat" memory space? |
|||
04 Jul 2005, 13:38 |
|
Tomasz Grysztar 04 Jul 2005, 13:46
You still use segments, since it's still the real mode. What makes it FRM is that you can use 32-bit offset within each segment.
|
|||
04 Jul 2005, 13:46 |
|
adefeo 04 Jul 2005, 13:56
Thanks for all of your help! I think I'm OK for now...
|
|||
04 Jul 2005, 13:56 |
|
Chewy509 04 Jul 2005, 22:40
adefeo wrote: Thanks for all of your help! I think I'm OK for now... Hi Adefeo, Take a look at my last years 512byte OS enrty, it ran in FRM, so you could use it as a working model. It should answer all your questions. Darran. PS. http://chewy509.atspace.com/256.html |
|||
04 Jul 2005, 22:40 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.