Entering Unreal Mode
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
Entering Unreal Mode
Ok, I don't know if I am failing to enter unreal mode or there is just a weird thing with my kprint function running in it. This code will print a million flashing characters on the screen after it prints a few red text lines.
- Attachments
-
- kanu.tar.bz2
- (1.18 KiB) Downloaded 62 times
Kanu Operating System
Working on:Paging and Multitasking
BURN /\/\1(40$0|=7
Working on:Paging and Multitasking
BURN /\/\1(40$0|=7
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
Oh.
your code is confusing me a bit. I think it'd be easier, if you know you're in
protected mode, to do something like:
Also keep in mind that you're not going to have a terribly large amount
of space if you put an Unreal Mode kernel above 1MB.
edit: err... sorry, that code seemed rather obfuscated. I think you're
just missing the jump.. ? Do you intend to be using 32bit code or
16bit code? Unreal Mode is just real mode (16bit code) capable of using
32bit addresses.
your code is confusing me a bit. I think it'd be easier, if you know you're in
protected mode, to do something like:
Code: Select all
mov eax, cr0
xor eax, 1
mov cr0, eax
xor eax, eax
mov ds, ax
mov ss, ax ; your code sets ds twice btw
;jmp I don't feel like doing the math for a long jump to fix CS
from above 1MB anyway.
of space if you put an Unreal Mode kernel above 1MB.
edit: err... sorry, that code seemed rather obfuscated. I think you're
just missing the jump.. ? Do you intend to be using 32bit code or
16bit code? Unreal Mode is just real mode (16bit code) capable of using
32bit addresses.
Last edited by Hangin10 on Tue Mar 04, 2008 3:16 pm, edited 1 time in total.
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
- Masterkiller
- Member
- Posts: 153
- Joined: Sat May 05, 2007 6:20 pm
If you are in protected mode just do that:
Another one mistakes in your k-print.
1. Unreal-mode is real-mode with a chance to get access to 4GB physical memory. It is a 16-bit mode, so LODSB loads a string from DS:SI, not from DS:ESI. You should have separate print functions for real and protected mode.
2. You don't have to mov a loaded value to BL to or it, OR al, al is faster because accumulator has direct access to ALU
Code: Select all
MOV eax, cr0
AND al, 0xFE
MOV cr0, eax
1. Unreal-mode is real-mode with a chance to get access to 4GB physical memory. It is a 16-bit mode, so LODSB loads a string from DS:SI, not from DS:ESI. You should have separate print functions for real and protected mode.
2. You don't have to mov a loaded value to BL to or it, OR al, al is faster because accumulator has direct access to ALU
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife