flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > x86/x86_64 compatible OS |
Author |
|
edfed 14 Sep 2010, 22:22
i think that you should write the OS in 32 bits, with an extension for 64 bits, just a sort of bridge that let you use 64 bits registers, paging, and mode, within a 32 bits application.
something like an interrupt? INT 64h: if pmode then, switch longmode if long mode then, switch pmode if rmode then do nothing iret no? then, to use 64 bits code in your app, just do that: Code: use32 ... mov [eax],eax ... int 64h use64 ... mov rax,[rax] ... int 64h use32 ... mov eax,[eax+eax] |
|||
14 Sep 2010, 22:22 |
|
Coty 14 Sep 2010, 22:34
Wow, thanks for the fast reply!
So want I want to do is possible? OK, well that Manuel switch sounds good, I think I will: automatically detect modes, save a 0 or a 1, (0=32, 1=64), then place in the front of every application 1 byte, that says what mode is needed and the OS auto swiches to it, for example in my OS I plan to load the first byte and test it: Bit 0: If 1, Need to be 1 (help verify valid app.) Bit 1: If 1, APP needs FPU Bit 2: If 1, APP needs MMX ... Bit 7: If 1, App needs 64bit and the user can use an interupt to switch back and forth ect. Thank you edfed! |
|||
14 Sep 2010, 22:34 |
|
edfed 14 Sep 2010, 22:44
soon, i'll restart to play with protected mode switch, and hope to write a very good pm/rm switcher, using an interrupt.
for example, INT 64h good luck! |
|||
14 Sep 2010, 22:44 |
|
Coty 15 Sep 2010, 14:21
Why not 40h? Since 40h is translated into the real, whole number of 64, like an easter egg or something
|
|||
15 Sep 2010, 14:21 |
|
baldr 15 Sep 2010, 15:04
Coty,
64h == 100 |
|||
15 Sep 2010, 15:04 |
|
Coty 15 Sep 2010, 18:05
baldr,
Your ability to convert numbers amazes me int 40h == 64 dec, == 64bit swap (hidden surprise since everyone says the hex value not the dec in interrupt tables)... 64h is 100dec, long mode != 100 bits |
|||
15 Sep 2010, 18:05 |
|
baldr 15 Sep 2010, 18:50
Coty,
I don't know why edfed chooses int 64h, too. |
|||
15 Sep 2010, 18:50 |
|
edfed 15 Sep 2010, 20:20
because i always write interrupt request in hexa.
then, in my idea, i want to create (the 12th october 2045) a set of interrupts, that uses letters A to F, and decimal digits as a mnemonic. for example, int for the screen can be int 0FBh (Frame buffer) int for IDE0 bus = int 0D0h, int 0D1h for ide1. then, int for 64 bit mode is int 64h. to respect "the rule" of int in hexadecimal. but it is not an obligation, just a suggestion. |
|||
15 Sep 2010, 20:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.