flat assembler
Message board for the users of flat assembler.

Index > OS Construction > bootloader usb driver

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 18 Dec 2007, 02:28
boot sector is on floppy or else, the rest is on USB pen at a random location.
Is it possible within 460 bytes to code a int13 equivalent for USB pen? 50 restant are for int13-based bootloader, the 2 last ones are for boot mark 0AA55h
Post 18 Dec 2007, 02:28
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 18 Dec 2007, 18:46
Yes and no, to boot from usb pen, you need to emulate floppy or hdd (so you can use int 13h for that).
But you can not boot from floppy and then load from usb pen drive, without removing the floppy and rebooting.
Post 18 Dec 2007, 18:46
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 18 Dec 2007, 21:41
Quote:

but you cannot boot from floppy and then load from usb pen drive, without removing the floppy and reboot

why?
Grub is able to load different bootloaders...
To reload a boot, simply load it at seg:7C00h and jump to this location, the problem is:
it is possible to read a usb pen with a PIO function less than 460 bytes?
if possible , where to find the documents, reading usb pen with pio.
Post 18 Dec 2007, 21:41
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 18 Dec 2007, 23:51
Dex4u wrote:
Yes and no, to boot from usb pen, you need to emulate floppy or hdd (so you can use int 13h for that).
But you can not boot from floppy and then load from usb pen drive, without removing the floppy and rebooting.


Sure you can, if you program the USB pendrive directly, instead of relying on BIOS floppy emulation.

What's the obsession with 512 byte bootsector anyway, there's plenty more room on a floppy than just the bootsector...

_________________
Image - carpe noctem
Post 18 Dec 2007, 23:51
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 19 Dec 2007, 01:46
f0dder wrote:
Dex4u wrote:
Yes and no, to boot from usb pen, you need to emulate floppy or hdd (so you can use int 13h for that).
But you can not boot from floppy and then load from usb pen drive, without removing the floppy and rebooting.


Sure you can, if you program the USB pendrive directly, instead of relying on BIOS floppy emulation.

What's the obsession with 512 byte bootsector anyway, there's plenty more room on a floppy than just the bootsector...


No you can not, the only way is to use emulation, or code a usb stack, not likely in 460 bytes.
You must be living in dream land, Why do you need to add a USB stack to Dos, if you can read/write to it using pio or int 13h ?, The simple answer is, you can not without emulation and by booting from it (or coding a USB stack ).
Once you boot from it, you can use emulation in realmode, but it stops if you go to pmode.

Theres a small chance of it working, if maybe you have no hdd installed.
Post 19 Dec 2007, 01:46
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 19 Dec 2007, 02:16
in fact, i have some problems with floppies, as i don't want to buy new ones, i use some dead floppies, only the boot sector is good, the rest is bad.
i cannot boot from usb pen on my machines, but i can from floppy

why emulation? i don't see what you mean by emulation.

i just want to read the content of the memory chip on the usb drive and you speak about emulation. it's strange...

i don't want a dos dependant usb pen driver
do you understand?
i spoke about int13h and PIO as exemple, not as restrictions.

Code:
mov dx,usb_drive_IO
in eax,dx 
;that's all i want.
    
Post 19 Dec 2007, 02:16
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 19 Dec 2007, 02:38
edfed wrote:

i cannot boot from usb pen on my machines, but i can from floppy
why emulation? i don't see what you mean by emulation.
i just want to read the content of the memory chip on the usb drive and you speak about emulation. it's strange...
i don't want a dos dependant usb pen driver
do you understand?
i spoke about int13h and PIO as exemple, not as restrictions.

edfed my dear chap, because you want a easy way, does not mean there is one.
USB are one of the hardest device to code for, why do you think LINUX had a problem.
You can write a USB stack (alot of work), but in your case you can not use any other way (as you can not boot usb )
Emulation is away to use usb, by tricking the boot loader into thinking its loading from a floppy or hdd using int 13h, but your BIOS need to be able to do that, yours can not.

Your best loading from a normal hdd.

Note: I have done a lot of work with USB, i am working on a USB stack for DexOS right now, 5 months and i only have the basic's done.


Last edited by Dex4u on 19 Dec 2007, 02:39; edited 1 time in total
Post 19 Dec 2007, 02:38
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 19 Dec 2007, 02:39
edfed, by emulation they mean BIOS emulation, like "El Torito" does. When you use the INT13, the BIOS will fool your boot code making it beleave that the pen is either a HDD, a Floppy or a CDROM (and maybe some other types of emulation exists).

http://www.ctyme.com/intr/int-13.htm <- Check from Int 13/AH=4Ah to see somewhat related stuff
Post 19 Dec 2007, 02:39
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 789
Location: Adelaide
sinsi 19 Dec 2007, 02:40
edfed wrote:

Code:
mov dx,usb_drive_IO
in eax,dx 
;that's all i want.
    

Heh, if only it was that easy.

Look here for a DOS USB driver http://www.dosusb.net/
Post 19 Dec 2007, 02:40
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 19 Dec 2007, 02:41
i understand now.
i'll use the first 4kbyte of my hdd ( unsused by FAT32 )
it's sufficient for the moment.
thanks
i'll wait your code as exemple.
Post 19 Dec 2007, 02:41
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 19 Dec 2007, 02:44
so if i well understand, usb drive need a lot of routines to works. ok.

aïe aïe äïe
headacke
Post 19 Dec 2007, 02:44
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 19 Dec 2007, 12:09
Dex4u wrote:
f0dder wrote:
Dex4u wrote:
Yes and no, to boot from usb pen, you need to emulate floppy or hdd (so you can use int 13h for that).
But you can not boot from floppy and then load from usb pen drive, without removing the floppy and rebooting.


Sure you can, if you program the USB pendrive directly, instead of relying on BIOS floppy emulation.

What's the obsession with 512 byte bootsector anyway, there's plenty more room on a floppy than just the bootsector...


No you can not, the only way is to use emulation, or code a usb stack, not likely in 460 bytes.
You must be living in dream land, Why do you need to add a USB stack to Dos, if you can read/write to it using pio or int 13h ?, The simple answer is, you can not without emulation and by booting from it (or coding a USB stack ).
Once you boot from it, you can use emulation in realmode, but it stops if you go to pmode.

Theres a small chance of it working, if maybe you have no hdd installed.


Re-read my post?

Writing a USB stack is what I meant, and hence also why I asked about the bootsector-size obsession, because obviously you can't fit an USB stack in 460 bytes.

_________________
Image - carpe noctem
Post 19 Dec 2007, 12:09
View user's profile Send private message Visit poster's website Reply with quote
moile



Joined: 04 Feb 2005
Posts: 16
Location: nothing
moile 19 Dec 2007, 21:00
and is it possible to write it within 8 sectors?
this is the maximum of contiguous good sectors i have on my floppies!
Post 19 Dec 2007, 21:00
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.