Page 1 of 1

doubt on int 10(0e) & reading sector

Posted: Fri Jan 07, 2011 8:57 am
by wenn
hello guys i have few doubts from int 10 and reading sector from usb

i)int 10h

Code: Select all

int 10
	AH = 0E
	AL = ASCII character to write
	BH = page number (text modes)
	BL = foreground pixel color (graphics modes)
As you can see what is page number(in BH register) and what do they exactly mean by graphics mode(BL) i mean should i set any register to make use of graphics mode(Sorry i didn't learn the graphics tutorial's but i will once i get a grip at the basics)

ii)OK the tutorials say we can use int 13h to read/reset the floppy disk etc but how can i read sectors from USB because i am testing the code with an USB drive

Thanks!

Re: doubt on int 10(0e) & reading sector

Posted: Sat Jan 08, 2011 2:18 pm
by halofreak1990
wenn wrote:hello guys i have few doubts from int 10 and reading sector from usb

i)int 10h

Code: Select all

int 10
	AH = 0E
	AL = ASCII character to write
	BH = page number (text modes)
	BL = foreground pixel color (graphics modes)
As you can see what is page number(in BH register) and what do they exactly mean by graphics mode(BL) i mean should i set any register to make use of graphics mode(Sorry i didn't learn the graphics tutorial's but i will once i get a grip at the basics)
I don't really know about BH here (don't have my bootloader source at hand)
BL is the foreground pixel color in graphical text modes, which is the colorful text mode the XP installer, for example starts in.
wenn wrote: ii)OK the tutorials say we can use int 13h to read/reset the floppy disk etc but how can i read sectors from USB because i am testing the code with an USB drive
Are you using a USB floppy drive, or USB-stick?

If the BIOS is set up to emulate a USB-stick as a floppy, I guess normal floppy operations will work.
And as far as I know, a USB floppy drive is picked up by the BIOS as what it is: a floppy drive

Re: doubt on int 10(0e) & reading sector

Posted: Sat Jan 08, 2011 3:58 pm
by wenn
thanks for the reply and i am using USB stick.

as you know floppy is outdated and i already have a 128MB memory card which i can connect to my system as a USB stick using a card reader.

Re: doubt on int 10(0e) & reading sector

Posted: Sun Jan 16, 2011 2:22 pm
by Andyhhp
When using the BIOS to emulate a floppy drive, normal floppy commands will work. However, you have to make sure you save dl when entering the bootloader as it contains the drive number refering to the medium which was booted, and you will have to use that in preference to "drive 0" which is hardcoded in the int 13 call in the example.

Re: doubt on int 10(0e) & reading sector

Posted: Mon Mar 14, 2011 7:37 am
by roboman
The page number, in most cases your graphics card has more memory then is needed to display the screen of info in the mode you selected. That extra memory gets used as pages, or a number of hidden screens. The two big things pages get used for is 1) early programs that had several screens of information would put that information to the pages and update the information on those pages and then use int10 AH = 05h AL = new page number, to switch to what ever page the user wanted to view at that moment. 2) for graphics and even text to some extent, if you aren't very careful how you write to the screen you get flicker and snow. If page 0 is your viewed page, you can write to say page 1 and you get no flicker or snow. You then change from page 0 to page 1 with no flicker or snow and didn't have to be careful about how you wrote to the page or when. You can then update page 0 with the next bit of graphics movement and change from 1 to 0..... you just keep doing that and you have your animation, mouse movement or what ever, nice clean with no flicker or snow. So the page number is just what page you want to write to. When you start a graphics mode you are in page 0 and writing to page 0 will put the text on the screen. If you are in a text mode the background color is part of the text color information, when you are in a graphics mode you need to tell the bios what background color you want to use.

If the usb was your boot drive then the bios treats it exactly as if it was a hdd or fdd, depending on what type of emulation it was formatted in. You read or write to it from bios just like it was a drive.