flat assembler
Message board for the users of flat assembler.

Index > OS Construction > memory

Thread Post new topic Reply to topic

Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle 12 Dec 2004, 04:05
Ok lets go!
very old board with 16MB ram, I try to make a basic "system" command line only (no GUI)

operations done:
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:

Arrow -does the processor automately switch the aviable memory when I use all the address space?

Arrow -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.
Post 12 Dec 2004, 04:05
View user's profile Send private message Reply with quote

Joined: 18 Aug 2004
Posts: 8
Location: Kerala, India
thomasantony 20 Jan 2005, 12:20
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

Thomas Antony

C is Moronic, C Programers are morons!! Very Happy

My website : http://www.tomasm.tk
Post 20 Jan 2005, 12:20
View user's profile Send private message Visit poster's website Reply with quote

Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 09 Feb 2005, 03:51
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 only allocate whole pages at a time. This is fine if you only ever want to allocate memory in multiples of 4KB (on the x86), but not much use if you’re using things like linked lists (which you will be).

    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.
Post 09 Feb 2005, 03:51
View user's profile Send private message Visit poster's website Reply with quote

Joined: 14 May 2005
Posts: 7
Scanner 14 May 2005, 12:17
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 Smile

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.
Post 14 May 2005, 12:17
View user's profile Send private message Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.