Hello again...
so far i have set up a GDT,IDT and routine services...and a keyboard handler...
well what i want to do next is load some files from the floppy disk in pmode...the bootloader do so using ints (while loading my kernel in real mode)....
so do i need to setup v86 in order to do so..?
and i also want to switch to grapic mode....for that i'm pretty sure i'll need to use V86..but would i'll able to output text on the screen using my printf?
secondly as of now i don't want to implement multitasking...so would that make setting up v86 difficult?
and i also would like my keyboard handler to handle the keyboard I\O..would V86 let me to do?
well.... having a GDT,IDT and ISRs in place ..how hard would implementing V86 be?...
please answer
thnx
V86 a wise choise?
-
- Posts: 10
- Joined: Sat Jul 15, 2006 7:41 am
V86 a wise choise?
The Blues Had A Kid And They Named It Rock N' Roll
First i think your best off going to realmode and back to pmode, for doing bios int, this work great for mode changing and floppy loading, and its not too slow, + you can load from USB key fobs too.
I have made a demo that goes to and from realmode, for vesa mode change (you can easy make it do int 13h functions), let me know if you want me to post a link.
Also if you want to see how good this meford work for floppy load, you can down load my OS and try it: http://www.dex4u.com/
I have made a demo that goes to and from realmode, for vesa mode change (you can easy make it do int 13h functions), let me know if you want me to post a link.
Also if you want to see how good this meford work for floppy load, you can down load my OS and try it: http://www.dex4u.com/
-
- Posts: 10
- Joined: Sat Jul 15, 2006 7:41 am
http://www.dex4u.com/demos/DemoVesa.zip
You need vesa2 to use the demo, as it displays 640x480 32bpp, faded screen, waits 10 seconds and than switch's to realmode changes to text mode, back to pmode, prints message, waits 10seconds and keeps loop until you turn PC off.
Note: i was called "ASHLEY4" when i made this, but in some country's its a girls name so i changed to Dex.
You need vesa2 to use the demo, as it displays 640x480 32bpp, faded screen, waits 10 seconds and than switch's to realmode changes to text mode, back to pmode, prints message, waits 10seconds and keeps loop until you turn PC off.
Note: i was called "ASHLEY4" when i made this, but in some country's its a girls name so i changed to Dex.
-
- Posts: 10
- Joined: Sat Jul 15, 2006 7:41 am
well can n u post or link examples regarding mode switching?
i mean i tried getting back to real mode from pmode but it generated "gerneral protection fault"...which was expected since i didn't change the IDT pointer for real mode(i guess thats what it was)
i'm okay in C but new to asm...so any help would be great
btw Ashley how are the English doin now? any chance at the worldcup this time around? lol
i mean i tried getting back to real mode from pmode but it generated "gerneral protection fault"...which was expected since i didn't change the IDT pointer for real mode(i guess thats what it was)
i'm okay in C but new to asm...so any help would be great
btw Ashley how are the English doin now? any chance at the worldcup this time around? lol
The Blues Had A Kid And They Named It Rock N' Roll
The code is in the above link.
But quick example for changing to text mode:
Note: when you boot you need to save some realmode settings, see in the above link.
PS: Worldcup is well gone, only winner remember it
But quick example for changing to text mode:
Code: Select all
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; Back to realmode for textmode int's. ;
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Real_TextMode_int:
pushad
jmp 20h:do_16t
use16
do_16t:
mov ax,28H
mov ds,ax
mov ss,ax
nop
mov bx,[RealModeCS] ; push real-mode CS:IP
push bx
lea bx,[do_rm2]
push bx
; clear PE [protected mode enable] bit and return to real mode
mov eax,cr0
and al,0xFE
mov cr0,eax
retf ; jumps to do_rm
;''''''''''''''''''''''''';
; 16-bit real mode again ;
;.........................;
do_rm2:
mov ax,cs ; restore real-mode segment register values
mov ds,ax
mov ss,ax
nop
mov es,ax
mov fs,ax
mov gs,ax
lidt [ridtr] ; point to real-mode IDTR
push cs
pop ds
push ds
pop es
mov ax,0xB800
mov es,ax
sti ; re-enable interrupts
;''''''''''''''''''''''''''';
; 16-bit real mode int's ;
;...........................;
mov ax,0x0003
int 10h
;''''''''''''''''''''''''''';
; real mode int's end ;
;...........................;
cli ; Disable interrupts,
lgdt [gdtr] ; Load the GDTR with the base address and limit of the GDT
mov eax,cr0 ; Set the PE [protected mode enable] bit in register CR0
or al,1
mov cr0,eax
jmp sys_code:do_pm111 ; jumps to do_pm
;''''''''''''''''''''''''''';
; 32-bit protected mode ;
;...........................;
use32
do_pm111:
mov ax,sys_data
mov ds,ax
mov ss,ax
nop
mov es,ax
mov fs,ax
mov gs,ax
mov ax,8h
mov es,ax
popad
ret
PS: Worldcup is well gone, only winner remember it
-
- Posts: 10
- Joined: Sat Jul 15, 2006 7:41 am
-
- Posts: 10
- Joined: Sat Jul 15, 2006 7:41 am