Page 1 of 2
Help in INT19h
Posted: Sat Mar 29, 2008 3:11 am
by East
I want to know the int 19h deeply.(ie) how it can be used, Is there any relation b/w the OS and this interrupt.Can anyone help me
Posted: Sat Mar 29, 2008 3:21 am
by inflater
If your OS is in real mode, with this interrupt you can reboot more quickly. INT 19h will not trash any user-defined interrupt handlers (unlike JMP FAR 0xFFF0:0F00, CTRL+ALT+DEL or hard reset). Usually, calling INT 19h will boot OS from a floppy, according to your BIOS's boot sequence.
For more information, check out the Interrupt jump Table:
http://lrs.uni-passau.de/support/doc/in ... B-2206.HTM
Regards
inflater
Posted: Sat Mar 29, 2008 3:31 am
by East
Thanks for the reply.
I am new to BIOS, its concept and invoking interrupts. Started learning it. Can i invoke the int 19h interrupt from user defined application like calling timer interrupts..Sorry if i have asked anything foolish...
Posted: Sat Mar 29, 2008 4:52 am
by inflater
If you are in (un)real mode, you can call any BIOS services and access to it's memory (disk drive configurations etc). You just pass the required parameters into registers, say AX, BX, CX etc. and invoke the interrupt. INT 19h doesn't need parameters, only DL for the drive number (0 - 1st floppy drive, 80h - 1st hard disk) etc. On the other side, INT 19h -at least on some PC emulators- seems to ignore the boot media specified in DL...
If you are in protected mode (e.g. started writing your OS using bran's kernel dev tutorial), you can't access BIOS using it's interrupts or memory. You need to do everything from scratch: disk I/O, screen I/O, peripheral support etc., by using port I/O - instrunctions OUT and IN. It's somewhat harder than using BIOS services, but it has some advantages: accessing the ports doesn't halt your system until the work has been done, unlike BIOS. If you have command-line singletasking OS, it doesn't matter much, but when you will switch to graphics interface development and multitasking, you will see the disadvantages of BIOS INT services. You can see this clearly in Windows 3.0 in real mode (not 3.1x) -> any e.g. floppy reads will freeze the system until it will stop reading.
If you want to stay in real mode, I suggest reading unreal mode topic on OSdev wiki. The difference between real and unreal mode is, that in unreal mode you can access max. 4GB of memory (real mode has the 1MB limit), but there exists segmentation and the code is capped to 64K segments. Remember HIMEM.SYS from MS-BOSS? Yes, DOS could be in unreal mode since version 5.0. But why McRioSoft did implement EMS and it's driver EMM386.EXE, it's beyond me
Regards
inflater
Posted: Sat Mar 29, 2008 5:00 am
by East
Thanks for the reply. my aim to use the interrupt 19h from my linux application. By using int 19h I want to load the OS which is loaded in second partition of my HDD.Is it possible. How to identify the real and protected modes.Help would be greatly appreciated.
Posted: Sat Mar 29, 2008 5:05 am
by inflater
Using any BIOS interrupts in Linux environment is not possible, because Linux is in protected mode (or the so-called long mode, the 64bit versions).
How to identify protected mode? Well... the easiest thing is to load some operating system in Bochs emulator and to see the bochs log. There you will find if it's pmode/long mode or not.
BTW all operating systems except MS-DOS since 1991 are in protected mode,e.g.: Windows 3.1, Windows 95, Windows 98, Windows NT,...
Posted: Sat Mar 29, 2008 5:25 am
by East
Thanks for the reply. If i want to use int 19h in protected mode, can u help me from which point i have to start to work on int 19h , i am new to this as i already said.
Posted: Sat Mar 29, 2008 5:42 am
by nekros
East wrote:Thanks for the reply. If i want to use int 19h in protected mode, can u help me from which point i have to start to work on int 19h , i am new to this as i already said.
You should read up dude, search Google, check things out, don't always ask on a forum , Google is quicker. It seems as if you are obsessing over "int 19". Int 19 is only a small thing read on the big picture then go to the resources section in the wiki and go to Ralf Browns interrupt list
EDIT: You can not use bios ints int protected mode, if you are going to write an OS I'm afraid you will have to start from scratch(almost).
Posted: Sat Mar 29, 2008 5:54 am
by inflater
East wrote:Thanks for the reply. If i want to use int 19h in protected mode, can u help me from which point i have to start to work on int 19h , i am new to this as i already said.
You can't do INT 19h in Win32/Linux386/(...). Period. Read the OSdev wiki,
http://www.osdev.org/wiki/Main_Page or else, for others you will be pain in the arse, nicely said.
Me wrote:If you are in protected mode (e.g. started writing your OS using bran's kernel dev tutorial), you can't access BIOS using it's interrupts or memory.
Altough Win2000/WinXP has a NTVDM - the DOS subsystem emulation, INT 19h wouldn't work there, neither on Windows 9x. This applies too for the direct disk access (2000/XP). Windows Vista doesn't support DOS applications, so you can dream about using interrupts there. - Added only for entirety.
Regards
inflater
Posted: Sat Mar 29, 2008 6:52 am
by East
Thanks for the replies
So i cant use the BIOS interrupts in protected mode. By switching over from protected mode to real mode can i use the BIOS interrrupt? Is it possible in linux
Posted: Sat Mar 29, 2008 7:18 am
by nekros
What the heck do you want to do. are you writing an OS? Then if you are remember this when writing it, There is no linux, no windows, no stdlib, no device drivers no crap at all!
Linux is not used to load an OS, I do not think you are suited for any kind of osdev at the moment.
Posted: Sat Mar 29, 2008 7:21 am
by nekros
Int 19 is used to reboot, it can not load anything at all the bios is the thing that loads the bootsector which then loads the OS read!
Posted: Sat Mar 29, 2008 7:35 am
by East
nekros wrote:Linux is not used to load an OS, I do not think you are suited for any kind of osdev at the moment.
I know linux is an OS and it is not used to load one more OS. I have asked switching b/w protected and real modes are possible in linux?
Posted: Sat Mar 29, 2008 7:50 am
by inflater
NO.
Only if you would develop your
OWN OS. Read the fucking wikipedia man
Linux, Windows, Solaris, MacOS, BeOS and God knows what can't be used for bootstraping your OS. Period!
Posted: Sat Mar 29, 2008 7:59 am
by nekros
Programs run in user mode in most OS's they have no control over the modes of the OS. I will restrain myself from my thoughts here they are:
<censored - Combuster>
In case you don't understand RTFW here it is.......
READ THE FUCKING WIKI!!!!!!