flat assembler
Message board for the users of flat assembler.

Index > OS Construction > How to read first sector from removable media

Author
Thread Post new topic Reply to topic
viki



Joined: 03 Jan 2006
Posts: 40
Location: Czestochowa, Poland
viki
I need to read first sector of removable media with bios function. How to do this?
Post 20 Apr 2006, 08:49
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
i believe that when doing it through bios, it depends what kind of media it is
Post 20 Apr 2006, 10:51
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
viki



Joined: 03 Jan 2006
Posts: 40
Location: Czestochowa, Poland
viki
I mean a pen drive
Post 20 Apr 2006, 11:16
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
You do that by trying the following, first you need a BIOS, that can boot USB, second when you put the pen drive in and boot, go to the Bios and see if it emulates it as a floppy or hdd, if its emulates a floppy then you read it like you would a floppy or if a hdd you read it as a hdd.
The reading of both these are the same for first sector, but differ from there on.
Note: If it floppy emultion, it will useally be as a fat16 floppy, not fat12.
The easist way to boot from a pen drive is to format it and sys file it to make it bootable, then make your OS bootable from dos.
Post 20 Apr 2006, 12:03
View user's profile Send private message Reply with quote
viki



Joined: 03 Jan 2006
Posts: 40
Location: Czestochowa, Poland
viki
thx I will check it immediately.

ok it works. I set boot from usb-hdd in bios, because when I booting from usb-fdd does't work.

I format usb using far16 then I sys it with win98, put autoexec and config and some useful programs and small app written by me in bc.exe and finally I read this first sector and it's fat16. Thanks again for quick help.
Post 20 Apr 2006, 12:17
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Your welcome, You can read/write from usb pen drive from pmode, by switch to and from realmode and using int 13h for read/write, thats what i do in my OS, its got 2 drivers for both floppy and hdd.
One a pmode driver, the other a BIOS driver, it works well, but is slow Wink.
Post 20 Apr 2006, 13:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.