flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Best Memory Model Goto page 1, 2, 3 Next |
Which memory model is the best? | |||||||||||||||||||||
|
|||||||||||||||||||||
Total Votes : 15 |
Author |
|
sinsi 14 Sep 2008, 08:15
Long mode must use paging, so you don't really have a choice.
|
|||
14 Sep 2008, 08:15 |
|
Adam Kachwalla 14 Sep 2008, 08:20
OK, but in long mode am I able to use segmentation on top of paging?
Hang on... how does 64-bit Windows use flat memory model then? |
|||
14 Sep 2008, 08:20 |
|
vid 14 Sep 2008, 08:58
No, you can't use segmentation in 64bit mode (only for FS and GS). I suggest you to take Intel or AMD manual and give it a good read.
|
|||
14 Sep 2008, 08:58 |
|
revolution 14 Sep 2008, 09:13
If all else fails RTFM. And if that also fails check out my website to find out how long mode works (and doesn't work).
But seriously, what is wrong with paging? Why do so many people seem to think it is the spawn of Satan? It is just a simple translation mechanism, and it makes a lot of OS related things so much easier to do. |
|||
14 Sep 2008, 09:13 |
|
Dex4u 14 Sep 2008, 13:40
You could use paging, but map it 1 to 1, which would be like not having paging.
|
|||
14 Sep 2008, 13:40 |
|
Adam Kachwalla 15 Sep 2008, 01:11
Dex4u wrote:
I'm not against paging, infact I think paging might make OS-DEV easier. But will it be more CPU intensive than using flat model? revolution wrote: But seriously, what is wrong with paging? Why do so many people seem to think it is the spawn of Satan? It is just a simple translation mechanism, and it makes a lot of OS related things so much easier to do. That's what I'm trying to find out. If there is a catch to using paging, is it really worth using or will it make my OS slower than a rock? If I use flat model, am I saving CPU time at the expense of making my OS bigger than Vista? |
|||
15 Sep 2008, 01:11 |
|
revolution 15 Sep 2008, 02:03
Adam Kachwalla wrote: I'm not against paging, infact I think paging might make OS-DEV easier. But will it be more CPU intensive than using flat model? Adam Kachwalla wrote:
What has given you the idea that paging is slow? Last edited by revolution on 15 Sep 2008, 02:05; edited 1 time in total |
|||
15 Sep 2008, 02:03 |
|
neville 15 Sep 2008, 02:04
revolution wrote:
Hi from across the ditch, Adam. I guess I might be one of the "spawn of Satan" believers referred to by revolution. This would probably be due to the discussion when I introduced my own 32-bit memory operating system FAMOS see http://board.flatassembler.net/topic.php?t=8945 FAMOS is presently in Flat Real Mode, which serves very well to demonstrate the concept of a memory OS. Your compatriate Sinsi points out that 64-bit long mode MUST be paged, but I'm still hoping to find a way to effectively implement flat memory in my 64-bit version of FAMOS. I'm not totally opposed to paging, but I am opposed to Virtual Memory in "modern" operating systems. VM is now an antiquated idea IMHO. Trouble is, paging often seems to lead to VM (but shouldn't have to). Paging itself must also increase both CPU and code overhead IMHO, so any OS which implements paging is likely to be both slower and larger. So I'll stick my neck out again and vote for flat in your poll. Yeah! _________________ FAMOS - the first memory operating system |
|||
15 Sep 2008, 02:04 |
|
Adam Kachwalla 15 Sep 2008, 02:10
Note that security and protection are also an important factor in this OS I'm deving. So that also would determine which memory model to use
revolution wrote: What has given you the idea that paging is slow? I just heard from other people and read from other websites that it is slow. I want to confirm this (because that would be disappointing as its VM features and security features look quite impressive compared with Flat Memory Model Last edited by Adam Kachwalla on 15 Sep 2008, 02:13; edited 1 time in total |
|||
15 Sep 2008, 02:10 |
|
revolution 15 Sep 2008, 02:10
What is wrong with VM? I find it useful in my 512MB laptop. For 99% of the time I don't need more than 250MB and everything runs smoothly, but when I run some app that want 600MB of memory then I am happy for the OS to pretend it has more RAM and use the HDD. Sure the app will run slower but that does not bother me, it is cheaper and easier than having to go and find some RAM at the computer store. If I needed 600MB 99% of the time then I would buy the extra RAM, but until that time comes VM will serve my purposes just fine.
|
|||
15 Sep 2008, 02:10 |
|
revolution 15 Sep 2008, 02:13
Adam Kachwalla wrote: Note that security and protection are also an important factor in this OS I'm deving. So that also would determine which memory model to use |
|||
15 Sep 2008, 02:13 |
|
Adam Kachwalla 15 Sep 2008, 02:14
revolution wrote: What is wrong with VM? Last edited by Adam Kachwalla on 07 Mar 2013, 03:02; edited 1 time in total |
|||
15 Sep 2008, 02:14 |
|
Adam Kachwalla 15 Sep 2008, 02:18
revolution wrote:
So does each application see an address range from 0x0000000000000000-0x################, or from 0x################-0x################? ie. can applications reference 0x0000000000000000 in the paging model and get the first page allocated to it, or do they have to refer to the actual location in memory/real page number? Also I want both speed and security, and if paging is only slightly and unnoticeably slower than flat memory model (a fly hitting a car; the car will slow down by a millionth of a kilometer-per-hour) than it is worth using! Can it handle a lot of memory requests in a given time? I have stuff in my OS that manipulate memory all the time |
|||
15 Sep 2008, 02:18 |
|
revolution 15 Sep 2008, 02:25
Adam Kachwalla: Read about paging in the Intel/AMD manuals. Rather than me try to explain the whole mechanism here it would be best to get such detailed info directly from the source.
In brief: Apps don't know the physical address of the memory they use. Apps always use virtual adddresses. |
|||
15 Sep 2008, 02:25 |
|
revolution 15 Sep 2008, 02:26
Adam Kachwalla wrote: Also I want both speed and security, and if paging is only slightly and unnoticeably slower than flat memory model (a fly hitting a car; the car will slow down by a millionth of a kilometer-per-hour) than it is worth using! Adam Kachwalla wrote: Can it handle a lot of memory requests in a given time? I have stuff in my OS that manipulate memory all the time |
|||
15 Sep 2008, 02:26 |
|
Adam Kachwalla 15 Sep 2008, 02:33
revolution wrote: Adam Kachwalla: Read about paging in the Intel/AMD manuals. Rather than me try to explain the whole mechanism here it would be best to get such detailed info directly from the source. All I needed here was to know whether or not to use paged memory model, and you've put a strong case. I think I'll go with paged memory module. Thanks for your help BTW I have a few questions: 1. What is the enormous "Virtual Memory" range 0x0000000000000000-0xFFFFFFFFFFFFFFFF for? NOBODY will ever have 16 exabytes of memory in a million years! 2. Why does Windows NT use flat memory model instead of paged when, by what you're saying paged is more reliable? Is it just a stupid mistake MS made (or rather MS+IBM, because OS/2 uses it as well!)? Or was it for compatibility with MS-DOS? Note that I'm not trying to be a "flat-memory-model advocate", I'm simply asking a question. |
|||
15 Sep 2008, 02:33 |
|
revolution 15 Sep 2008, 02:39
Adam Kachwalla wrote: 1. What is the enormous "Virtual Memory" range 0x0000000000000000-0xFFFFFFFFFFFFFFFF for? NOBODY will ever have 16 exabytes of memory in a million years! Adam Kachwalla wrote: 2. Why does Windows NT use flat memory model instead of paged when, by what you're saying paged is more reliable? Is it just a stupid mistake MS made (or rather MS+IBM, because OS/2 uses it as well!)? Or was it for compatibility with MS-DOS? Note that I'm not trying to be a "flat-memory-model advocate", I'm simply asking a question. |
|||
15 Sep 2008, 02:39 |
|
neville 15 Sep 2008, 04:05
Adam Kachwalla wrote: NOBODY will ever have 16 exabytes of memory in a million years! Less than 30 years ago, somebody thought that no computer would ever (i.e. not even in a million years) need more than 1 megabyte of memory space, RAM and ROM. So they disabled the 20th address line to try to make sure of it at the hardware level! You might have missed my post (about 9 up) where I put in a plug for Flat memory, but I agree that paged memory is better for OS security. But Virtual Memory as well adds a lot of complexity to memory management, and IMHO the advantages are outweighed by the disadvantages. (see the link in my post above). _________________ FAMOS - the first memory operating system |
|||
15 Sep 2008, 04:05 |
|
tom tobias 15 Sep 2008, 11:04
revolution, discussing his view of PAGING, wrote: ... Paging 1. definition: Operating System requirement (not option) to copy portions of task FROM hard disk TO system memory, AND then, to return unused portions of the task BACK to the hard disk again. 2. Philosophy: this is (yet another) example of wasteful, and utterly stupid activity (not evil) which is derived from the ERA of EXPENSIVE system memory. At that time, 1960's, no one could imagine a computer with 2 GB memory. How many tasks require that much memory? Apart from Astronomers and Mathematicians, who else is using 2 GB of memory, whether on a hard disk, (paged into memory) or sitting entirely in memory, for a single task? 3. Alternative: Load the whole task into main memory, one time. No further requirement to "page", hence, no overhead at all. Yes, it will take longer to COMMENCE the task, compared with a paged model. Adam started the thread asking about flat versus paging (itself a step child of segmentation philosophy). This debate really goes back to Intel versus Motorola, from thirty years ago, and I remain firmly in the anti-Intel camp. For your own OS, in my opinion, STICK to the SIMPLEST, which is FLAT, without concern for "protection", instead, make your OS simple, (or as Adam suggested: "light", which, in some circles, could be interpreted improperly, as implying insufficient hops), so that, upon infection, one simply reformats the OS partition, and reinstalls the OS, a matter of ten seconds from a well designed program operating from the DVD. Forget paging. Forget "protection". THINK memory! |
|||
15 Sep 2008, 11:04 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.