flat assembler
Message board for the users of flat assembler.
Index
> DOS > How to switch to pmode? |
Author |
|
rugxulo 02 Oct 2018, 07:55
(N.B. Your message subjects are horribly generic and not descriptive of what you're trying to do. It won't attract the right amount of attention because it's too vague.)
Pmode is possibly too complicated for you right now (while you're trying to figure out everything and the kitchen sink at once). I would recommend sticking with real mode (albeit with 386 instructions) until you get a grasp on the other details. (Hey, I don't personally grok pmode anyways!) If you insist on using 386 pmode, use an extender, e.g. WDOSX. It makes things much easier. Here's a very stupid example that I whipped up years ago. And you can use its debugger, too! BTW, unlike CWSDPMI (ring 3), WDOSX is ring 0! |
|||
02 Oct 2018, 07:55 |
|
DimonSoft 02 Oct 2018, 08:25
At the very least you have wrong offsets for your labels. And, no offsense, but rugxulo is right: you don’t seem to be experienced enough to dive into the topic and judging from the questions you’ve asked recently you’re trying to learn everything at once without actually going into deeper details. Assembly is not Java, learning it by mimicking someone else’s code and joining pieces you’ve found on the internet just doesn’t work.
|
|||
02 Oct 2018, 08:25 |
|
alexfru 02 Oct 2018, 08:30
rugxulo wrote: BTW, unlike CWSDPMI (ring 3), WDOSX is ring 0! CWSDPMI has an option (or a separate version) for ring 0. |
|||
02 Oct 2018, 08:30 |
|
Ben321 02 Oct 2018, 20:22
So it's possible to run WDOSX in ring0 mode, so your programs still have access to the IN, OUT, and INT instructions? How does set the interrupts though? I know that OSes or OS extenders in 32bit mode though usually use an IDT to set different interrupts from the default ones (like INT 0x10 switching video mode). So there's no guaranty (unless I'm writing a program that sets up the 32bit mode myself) that the default interrupts will remain the same interrupts in 32bit mode. So I really do prefer to set up my own 32bit mode within my own program, once I figure out how to do it.
|
|||
02 Oct 2018, 20:22 |
|
Ben321 02 Oct 2018, 20:28
I'm not even sure if the bytes are arranged correctly within the GDT entries. It would be nice if somebody here could point me to a "GDT Validator" type program, who's sole purpose was to allow you to paste the hexadecimal bytes of a GDT entry into a text box, and then it would tell you if it's a valid GDT, and display the value set for each field. That way I could be sure if my bytes for the GDT are arranged correctly.
|
|||
02 Oct 2018, 20:28 |
|
Tomasz Grysztar 02 Oct 2018, 20:52
If you look at the source code of fasm, in SOURCE/DOS/MODES.INC it contains a code that sets up 32-bit unreal mode. It does it by switching to protected mode and back, and you can find there an example of GDT.
A similar GDT is also present in my example of setting up long mode: https://board.flatassembler.net/topic.php?t=6206 Note that this example switches to protected mode very quickly, in just a couple of instructions, and then proceeds to set up 64-bit long mode, which is a bit more advanced matter. |
|||
02 Oct 2018, 20:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.