flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > 64-bit Flat Real Mode is possible!!! |
Author |
|
sid123 01 Apr 2014, 01:13
However remember that Long Mode ignores limit fields of most registers instead of filling the descriptor cache. So whatever limits you'll set LM will simply ignore it. The other problem is that some computers need the CR0.PG bit to be enabled for accessing 64bit extensions (R8-R15, XMM7-XMM15 etc.), switching back to Real Mode (on Intel processors) with CR0.PG enabled will cause an exception (IIRC).
The only thing I've seen close to 64-bit Unreal Mode is disabling an MSR (in AMD CPUs) which determines the 32-bit Address wrap, you can disable the MSR and have 8 GB of Memory Access through 2 segments in Unreal Mode. I'm not sure if Intel has this. Maybe neville will do something beyond my imagination...... |
|||
01 Apr 2014, 01:13 |
|
Feryno 01 Apr 2014, 05:42
Did also FS base and GS base (MSRs C0000100, C0000101) survive the mode switch? Both at AMD64 as well Intel?
|
|||
01 Apr 2014, 05:42 |
|
neville 01 Apr 2014, 22:39
Ok so I FOOL'd some people It was just my little April Fool's joke. I won't name those who PM'd me, but you know who you are! Is April Fool's Day recognised all around the world? One person who lives within a few hours of my time zone PM'd me but was obviously very suspicious
But all joking aside, I DO wish Real64 was possible! Why shouldn't our PC's have 64-bit CPU's that can access any 64-bit physical address via simple 64-bit direct addressing Just like we've always had since the 8088. _________________ FAMOS - the first memory operating system |
|||
01 Apr 2014, 22:39 |
|
neville 01 Apr 2014, 22:40
sid123 wrote: Maybe neville will do something beyond my imagination...... _________________ FAMOS - the first memory operating system |
|||
01 Apr 2014, 22:40 |
|
revolution 01 Apr 2014, 23:44
neville wrote: But all joking aside, I DO wish Real64 was possible! Why shouldn't our PC's have 64-bit CPU's that can access any 64-bit physical address via simple 64-bit direct addressing Just like we've always had since the 8088. |
|||
01 Apr 2014, 23:44 |
|
sid123 02 Apr 2014, 10:15
hi Neville,
If you want to simply run BIOS Interrupts in 64bit Mode you could either write an emulator (highly not recommended) or execute the code inside an existing emulator (libx86emu), or better make use of hardware virtualization, as I see it, you could simply track any faults happening due to code running inside the VM and handle them accordingly, it would be cool to see such a thing. As for the MSR I had been searching the whole day for that, and finally found it in the AMD Kernel and BIOS Developer Guides: Roll down to page 459 and you'll see this: AMD Kernel and BIOS Developer Guides wrote: Wrap32Dis: 32-bit address wrap disable. Read-write. Reset: 0. 1=Disable 32-bit address wrapping. Software can use Wrap32Dis to access physical memory above 4 Gbytes without switching into 64bit mode. To do so, software should write a greater-than 4 Gbyte address to MSRC000_0100 [FS Base (FS_BASE)] and MSRC000_0101 [GS Base (GS_BASE)]. Then it would address ±2 Gbytes from one of those bases using normal memory reference instructions with a FS or GS override prefix. However, the INVLPG, FST, and SSE store instructions generate 32-bit addresses in legacy mode, regardless of the state of Wrap32Dis Sadly it's specific to AMD CPUs I'm not sure why Intel doesn't have this. |
|||
02 Apr 2014, 10:15 |
|
revolution 02 Apr 2014, 10:42
sid123 wrote: I'm not sure why Intel doesn't have [Wrap32Dis]. |
|||
02 Apr 2014, 10:42 |
|
neville 02 Apr 2014, 19:31
revolution wrote: Maybe because having to use segment registers for addressing would cause nightmares for the devs when they think back to the bad old days of 8086 segmentation and all the problems and headaches it caused. I still live in hope that one day the x86 design line will eventually eliminate segments registers completely. However, you still seem to be happy with non-flat memory addressing and enforced paging with the associated problems, headaches and nightmares of Page Tables etc.? Virtual Memory addressing is fine, as an optional mode, but why shouldn't non-segmented flat memory also be at least an option (if not the default)? @sid123 Thanks for your research. I must try it on my AMD64 cpu one day. _________________ FAMOS - the first memory operating system |
|||
02 Apr 2014, 19:31 |
|
revolution 02 Apr 2014, 23:46
neville wrote: ... but why shouldn't non-segmented flat memory also be at least an option (if not the default)? |
|||
02 Apr 2014, 23:46 |
|
neville 04 Apr 2014, 05:40
revolution wrote: Do you really expect a different answer? Let's Get Real here (pun intended): 1. Microsoft et al pay the piper, so they call the tunes 2. Deliberate architectural complexity provides the means to protect big corporate interests 3. An elegantly-simple flat memory model as per my description would not be on the big corporate's wish list 4. Multitasking and dynamic memory allocation per se have nothing to do with it: both can be implemented in a simple flat memory model 5. Making a one-off CPU would be a completely pointless exercise for very obvious reasons. (So pointless and so obvious, one wonders why it would even rate a mention!) 6. AMD and Intel will only ever be convinced of anything by their fellow big corporates. See 1 above.... _________________ FAMOS - the first memory operating system |
|||
04 Apr 2014, 05:40 |
|
revolution 04 Apr 2014, 07:32
Some good reasons above.
1. Probably true. And they make up the "community". Although I would be less circumspect if the "et al" was fleshed out to more than just picking on MS. 2. I can't agree here. The complexity is mostly historical. Lots of companies have made alternative CPUs with simpler implementations. Easier to manage and test etc. means less overheads. 3. Definitely agree. Large companies don't like to support unsecurable OSes. Note, that doesn't mean the current OSes are secure, just that in principle they could be secured if the code weren't so hard to get right. But flat without paging or protection is not on any major players list. 4. Also true. But without process isolation things are less reliable and the public get upset when program A kills all other processes and the OS because the coder of A was careless. 5. You don't have to make a one-off. If your CPU design is popular other people can use it. Many companies have started in this way. 6. True. And that is why they won't invest time, effort and money if they feel there is not going to be a large enough usage case. A standard business decision process where idealism takes a back position to shareholder interests (i.e. profit). In short, I'm glad you agree with me about the reason that such a mode to not exist. You, I, and the rest of this board would be a tiny percentage of the market that Intel/AMD/etc. would be interested in supporting. Even all of us together could not form a large enough case to convince them to listen to us. It is not an ideal situation but it is where we are. |
|||
04 Apr 2014, 07:32 |
|
neville 05 Apr 2014, 03:28
I'm glad that by contradicting yourself on point 4, and some fancy footwork on several other points (see below), you've been able to agree with me on most things except the complexity issue
So I'm also glad that you've agreed with me that you earlier reference to "community" actually meant the big corporate players, and not "hobby" or other communities, like we fasmers for example, with little or no financial clout. That is an important distinction, and your initial statement could be construed as somewhat misleading on that point But I'm indifferent that you haven't been able to take that last little step and concede that a flat memory mode of whatever bus width is a uesful mode to have. Worse still you seem to think that I agree with you on this So because you're still obviously confused, I'll make another attempt to help you see where I'm coming from, if you want to of course! For further reassurance on Point 1, have a look at the Contributor's Lists on any of a huge plethora of industry-standard specifications such as busses, peripheral interfaces like USB, northbidges, southbridges etc. You will see certain names cropping up again and again... On Point 2, ask yourself what the "historical" reasons were. "Historical" by itself means little in this context as a justification. The irony is that Intel were ahead of the game in the early 8-bit days, when their main rival, Motorola, were stuck in the notion of memory-mapped I/O. Intel on the other hand recognised that a memory map without holes was much more desirable and so implemented separate memory and I/O address spaces, using an n+1th address line called IO/!M. Then later they almost ruined it all... On Point 3, realise that "unsecurable" is NOT a synonym for "without paging or protection". Another misleading juxtaposition here? Many levels of security can be implemented in many different ways, none of which require either paging or what we know as "Protected Mode". Also, the more complex the environment, the harder it is to get the code right. On Point 4, realise that "process isolation" can also be implemented in a variety of ways. Also a "careless" coder is an incompetent coder who will soon be weeded out if his code causes security issues for the OS or other processes. On Point 5, now setting oneself up to form a new company to design, mass produce, and market a new CPU which is 100% X86-64 compatible but also capable of 64-bit flat real mode is just crazy pie-in-the-sky stuff, so it's not even worth a serious mention. Assuming it was serious.... On Point 6, oh, you seem pretty well-informed on that! _________________ FAMOS - the first memory operating system |
|||
05 Apr 2014, 03:28 |
|
revolution 05 Apr 2014, 03:59
It is not me, or the rest of this board, you need to convince. Talk to Intel/AMD about it. As for point 6, profit is going to the the most poignant issue to discuss with Intel/AMD. If you can't satisfy their desire for that then you will find it a very tough sell. If you can convince them to support such a mode then my hat is off to you for achieving such a thing against the odds.
As for point 4, sure, I often contradict myself, but in this case I was just a bit sloppy in my description. "Proper" (heh, oh I like those scare quotes) multitasking and multiuser OSes need process isolation to prevent the users getting upset because of coder A. But "improper" OSes can also offer multitasking and mutiuser but with a much reduced confidence or reliability. No major player is going to actively want to allow coder A to compromise the entire system, hence the lack of significant usage case for such a mode. Only hobbyist devs with little time and money available desire such modes but that market is tiny. In a somewhat bizarre turn of events, with the inclusion of RIP relative addressing a non-paged multi-app OS would now be easier to implement in a flat model. But at the same time the availability of such a mode was removed. Kind of like AMD sticking the finger to hobbyist devs and saying "just teasing ya". |
|||
05 Apr 2014, 03:59 |
|
sid123 05 Apr 2014, 05:17
I am seriously (no sarcasm involved) going to ask Intel/AMD about this.
|
|||
05 Apr 2014, 05:17 |
|
neville 05 Apr 2014, 06:51
revolution wrote: In a somewhat bizarre turn of events, with the inclusion of RIP relative addressing a non-paged multi-app OS would now be easier to implement in a flat model. But at the same time the availability of such a mode was removed. Kind of like AMD sticking the finger to hobbyist devs and saying "just teasing ya". @sid123 Well we can promise them a market size of least 2 customers _________________ FAMOS - the first memory operating system |
|||
05 Apr 2014, 06:51 |
|
timryazthunder 09 Apr 2014, 17:35
It should be called "Complete Real Mode"
|
|||
09 Apr 2014, 17:35 |
|
sid123 12 Apr 2014, 07:54
timryazthunder wrote: It should be called "Complete Real Mode" Why? IMO Complete Real Mode would mean the 8086 Real Mode without any extended registers and instructions. _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD |
|||
12 Apr 2014, 07:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.