flat assembler
Message board for the users of flat assembler.
Index
> DOS > Is it possible to enter 64-bit mode from real mode directly? |
Author |
|
Dex4u 15 Jun 2006, 12:01
Yes if i understand the ?, as PC's boot up in realmode and you can go from Dos to pmode to long mode.
Here is some code to go from Dos to long mode, it needs converting to fasm, as it coded with YASM.
|
|||||||||||
15 Jun 2006, 12:01 |
|
yyc650102 15 Jun 2006, 16:56
I will try it!! Thanks a lot!!
|
|||
15 Jun 2006, 16:56 |
|
Mac2004 03 Jul 2006, 08:17
yyc650102: Have you succeeded in converting above source code into Fasm? I have tried and i think Fasm does not produce correct code. I removed all extra code in order to eliminate possible tripple fault causes.
The result: Yasm 0.50rc2 produces working code, Fasm 1.67 produces tripple faulting code. Tripple fault occures when sti command is issued in long mode. Regard, Mac2004 |
|||
03 Jul 2006, 08:17 |
|
Madis731 04 Jul 2006, 19:37
I started to convert it but there are some strange things happening:
Code:
movd rbx,mm6
What should it do - FASM doesn't allow it - and EVEN I do NOT allow it should it be: Code: movq rbx,mm6 shl rbx,32 shr rbx,32 ;Or better: movd ebx,mm6 changed a lot of stuff - compare my code with yours and if we find any differences - that's the place to start looking for errors. What I think that the lack of YASM's support for 64-bit computing is the cause of many problems and the workarounds that worked on YASM are now transfered falsely to FASM. A write from scratch!?
|
|||||||||||
04 Jul 2006, 19:37 |
|
Mac2004 05 Jul 2006, 12:37
Hi Madis731!
I have noticed similar problems while converting. I solved some problems by removing all not so necessary Yasm specific code from the original code. You can download the code altered by me from the link below. I agree with you that Fasm generally is more liable than Yasm. It's quite annoyning to 'fight' with assembler's own bugs that generate erroneous code. Here's the link to my code: http://board.flatassembler.net/topic.php?t=902 regards, Mac2004 |
|||
05 Jul 2006, 12:37 |
|
Mac2004 05 Jul 2006, 13:12
Madis731: I tested your version and it seems quite the same from essential parts except that I removed all debug code from my version.
The result is all the same: Code crashes when sti command is issued in long mode regards, Mac2004 |
|||
05 Jul 2006, 13:12 |
|
lazer1 06 Jul 2006, 14:56
yyc650102 wrote: As everybody knows that it's possible to directly enter PMODE even Page-Mode from real mode under DOS. However, is it possible to enter 64-Bit mode under DOS? someone found that you can go directly from real mode to long mode without going via protected mode, however when I tried this I had a problem with interrupts, if you switch off and dont use interrupts you can go directly from real mode to long mode: just study the Intel docs on real to PM and PM to LM and then initialise directly from real to LM, in the transition to LM make sure to set the PM CPU config bit as that isnt in the docs, and your code will fail without that, that bit needs to be set even if you are going from PM, :I wrote my code exactly as given in the Intel docs and it didnt function, once I set the PM bit then it did function, note that LM can only be used with the MMU so it is more work than PM which can be used without an MMU. whichever way you do it, you want to begin looking at LM without interrupts. Only when you understand how to code LM without interrupts should you attempt LM with interrupts. once you use an MMU you have to be careful about caching: memory mapped hardware must be via uncached memory, otherwise things could happen in the wrong order: the CPU caches intercept reads + writes and these only reach the bus in an unpredictable way so things will malfunction, you should probably switch off all caching to begin with until you can figure out how to do this properly as caching control is quite complicated (mtrr's) so to begin with use LM with no interrupts and no caching, interrupts and caching are both difficult topics and cannot be done in a hurry. the MMU also requires interrupts, however you dont need an MMU page fault handler if you carefully write your code only in mapped memory: , |
|||
06 Jul 2006, 14:56 |
|
nasm64developer 11 Jul 2006, 14:54
> someone found that you can go directly from real mode to long mode
> without going via protected mode, :P The only way to do that is via RSM. |
|||
11 Jul 2006, 14:54 |
|
Mac2004 11 Jul 2006, 20:09
nasm64developer: Can you specify where to find to direct long mode thing as you mentioned?
regards, Mac2004 |
|||
11 Jul 2006, 20:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.