Message board for the users of flat assembler.
> OS Construction > memory
Ok lets go!
very old board with 16MB ram, I try to make a basic "system" command line only (no GUI)
1 boot disk (from floppy)
2 autorun (GDT allocated IDT allocated -only Ring 0 PMODE activ)
3 selector point to 4GB address space but on this very old machine is only 16MB
I have no experience with this and have 2 questions:
-does the processor automately switch the aviable memory when I use all the address space?
-what will happen when the memory on the board will be not big enough to run programs?
Swap file will be needed as well I think but have no idea how to solve the problem yet.
Microsoft: brings power of yesterday to computers of today.
|12 Dec 2004, 04:05||
I am not a memeory management genius but I think the 4Gig is something caled virtual address space. You can make it point to any physical address using the GDT or by using Paging. For example you can make the kernel start at 2Gb mark but actually load it at the 1 meg mark. This has got something to do with setting the correct base addresses a in the GDT selectors so that the virtual address gets translated to the acorrect physical addresses. You can see something about this in the middle of a tutorial for paging at http://www.osdever.net
C is Moronic, C Programers are morons!!
My website : http://www.tomasm.tk
|20 Jan 2005, 12:20||
to include som details, look at http://www.osdever.net/tutorials/memory2.php and specifically this:
There are a few problems with the physical memory functions which make them unsuitable for everyday memory allocation like, say, malloc():
They deal with physical addresses, not virtual. This means that they donâ€™t naturally take advantage of a paged architecture, which would allow your kernel to arrange applicationsâ€™ address spaces independently of the layout of the computers RAM chips.
They donâ€™t do much with the memory they allocate: they don't allow things like sharing, swapping to disk, memory-mapped files, integration with the disk cache, etc.
|09 Feb 2005, 03:51||
1. Available memory is not switched automatically
2. Access to memory greater than physical will result in reading/writing from/to a void. The CPU will gladly write your data to lets say memory byte at 17M, but when you read the byte at 17M, you will not get back what you wrote (cause their ain't no memory there
As for tips on the swap file:
1. Get a storage medium driver working (such as IDE)
2. Read up on how paged mode memory works (refer to the intel pentium system manuals).
3. Write an Interrupt/Exception handler for page faults that will read/write the page file when pages of memory that is not loaded is accessed.
4. Setup and switch on paged mode.
O, and btw, good luck cause you will need it.
|14 May 2005, 12:17||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.