flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Starting with some complex stuff, Memory Segmentation in RM? |
Author |
|
sid123 22 Oct 2013, 12:33
Been playing around with MikeOS,
MikeOS has a 64K segment to do stuff. But the thing is I want 128K. I know sounds noobish (is that a word?) Alright some details : I discovered mikeos loads at 2000H in RAM. And it sets up ss (stack segment) to 0, and sp to fffh, Then it makes all the other seg regs to line up with the kernel Load point, And the memory structure is like Small mikeos 64K segment. Kernel 24K Disk buffer 8K Free space in that segment : 32K Now just after this segment I want to have another 64K segment, So that equals 128K of RAM. How would I start about? Would that be tough? Or its simple? Help would be appreciated...[/list] _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD |
|||
22 Oct 2013, 12:33 |
|
Mike Gonta 22 Oct 2013, 20:28
MikeOS32 has 4 Gb segments.
|
|||
22 Oct 2013, 20:28 |
|
sid123 23 Oct 2013, 08:40
@cod3b453 I see you allocated a 64K segment through ES and DX.
Now is this segment ready to use? MikeOS programs load at 32K, Since a segment has been created, is it possible to load stuff at 64K, and this segment would last till 128K. Right? @mikegonta Lol, but the thing is I want to learn OSDeving step by step, like assembly, first learn dos programming 16 bit, then Win32, and then Win64. I want to get the most out of real mode before shifting to protected mode, so I think messing with segment registers may help in the learning part.... |
|||
23 Oct 2013, 08:40 |
|
cod3b453 23 Oct 2013, 17:55
In my example the segment at es:0 is preallocated and so big enough for the disk data. I have no idea how MikeOS works or how it allocates memory so I can't help you but you can always address 64k. If MikeOS provides a memory allocation function you should probably use that to find a safe location to use for the size you've asked for.
To be honest there's very little in 16bit you should focus on: VGA/VESA for basic screen stuff, basic read-only disk driver(s), BIOS E820, A20 and switching to protected mode. |
|||
23 Oct 2013, 17:55 |
|
c.j.gowett 16 Jan 2014, 20:31
Like cod3b453 said, I'm sure you can split access between segments, but I haven't tested it myself. If you want more space, try 32-bit protected mode. you'll have 0xFFFFFFFF amount of space, or 4294967296 bytes (4 GB) of space. Some of the space is used for stuff like video memory, BIOS Data Area, and other device memory. Also, in 32-bit protected mode, you won't have interrupts, so you'll have to use i/o ports to write back to the hard disk or use other interrupts.
|
|||
16 Jan 2014, 20:31 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.