How can you see your are booting from USB and not HDD.
How can you see your are booting from USB and not HDD.
I want my OS to work on USB and HDD but how do i know where i'm booting from?
I know BIOS leave register DL (yes not BL) as boot device. But afther booting it's 80 for both.
Is there a way to read/write from USB afther enable Protected mode?
Can I stil use INT 0x13 function AH=0x42 ?
I know BIOS leave register DL (yes not BL) as boot device. But afther booting it's 80 for both.
Is there a way to read/write from USB afther enable Protected mode?
Can I stil use INT 0x13 function AH=0x42 ?
Last edited by Holus on Fri Oct 07, 2011 12:11 am, edited 3 times in total.
Computer says NOOOO
Re: DETECT BOOTING FROM USB
Actually, its DL not BL.Holus wrote:I want my OS to work on USB and HDD but how do i know where i'm booting from?
I know BIOS leave register BL as boot device. But afther booting it's 80 for both.
Yes there is. And that is....Is there a way to read/write from USB afther enable Protected mode?
Int 13h Extensions.Can I stil use INT 0x13 function AH=0x42 ?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: DETECT BOOTING FROM USB
Dont do that again.Holus wrote:DETECT BOOTING FROM USB
Re: DETECT BOOTING FROM USB
EBX bootimg DL bootdevice You are right.Chandra wrote:Actually, its DL not BL.Holus wrote:I want my OS to work on USB and HDD but how do i know where i'm booting from?
I know BIOS leave register BL as boot device. But afther booting it's 80 for both.
Yes there is. And that is....Is there a way to read/write from USB afther enable Protected mode?Int 13h Extensions.Can I stil use INT 0x13 function AH=0x42 ?
If i use INT 0x13 in protected mode the computer just reset.
Maybe the IDT is not set up right. I ask this because I don't know where I'm looking for.
I know there is a way to read from USB. Where to start?
Can I use the IDE controller?
Can I use ATA controller?
Do I have to can PCI for devices with CLASS CODE 0x01 and SUBCLASS CODE 0x80? (other mass storrage controller)
Or CLASS CODE 0x05 SUBCLASS CODE 0x01 (Flash controller)
Or do I have to build the whole thing using CLASS CODE 0x0C SUBCLASS CODE 0x03, 0x20 or 0x80??
I can not use the harddisk controller by using the ports 1F0 to 1F8.
That start reading from HDD. Even if the USB look like a HDD on bootup with DOS.
Computer says NOOOO
Re: DETECT BOOTING FROM USB
You can't use Bios services in 32 bit mode. You need to write your own drivers. I'm sure that Chandra knows that, I think he just didn't read your question correctly.
Reading from a USB drive using your own driver takes an enormous amount of work. I guess it's 20 times more work than an IDE driver. I recommend that, if this is your first OS/disk driver, you start with an IDE driver.
Reading from a USB drive using your own driver takes an enormous amount of work. I guess it's 20 times more work than an IDE driver. I recommend that, if this is your first OS/disk driver, you start with an IDE driver.
If a trainstation is where trains stop, what is a workstation ?
Re: DETECT BOOTING FROM USB
The IDE driver is working. With some help on OSDEV and GOOGLE.gerryg400 wrote:You can't use Bios services in 32 bit mode. You need to write your own drivers. I'm sure that Chandra knows that, I think he just didn't read your question correctly.
Reading from a USB drive using your own driver takes an enormous amount of work. I guess it's 20 times more work than an IDE driver. I recommend that, if this is your first OS/disk driver, you start with an IDE driver.
I hoped there was some simple sollution becouse it starts so nice and easy just like a HDD.
Do you know how to find out you booted from USB-flash drive and not from HDD?
Computer says NOOOO
Re: DETECT BOOTING FROM USB
No I don't think there is a simple solution. But since you have IDE you can now implement a USB stack.Holus wrote:The IDE driver is working. With some help on OSDEV and GOOGLE.
I hoped there was some simple sollution becouse it starts so nice and easy just like a HDD.
Do you know how to find out you booted from USB-flash drive and not from HDD?
Did you look in DL ? Your original post says BL.
If a trainstation is where trains stop, what is a workstation ?
Re: DETECT BOOTING FROM USB
If I boot from USB register DL=0x80 just like booting from HDD.gerryg400 wrote:No I don't think there is a simple solution. But since you have IDE you can now implement a USB stack.Holus wrote:The IDE driver is working. With some help on OSDEV and GOOGLE.
I hoped there was some simple sollution becouse it starts so nice and easy just like a HDD.
Do you know how to find out you booted from USB-flash drive and not from HDD?
Did you look in DL ? Your original post says BL.
That is the point. If I finished my drivers for USB in 2023 I still need to know what drivers I have to use to read from the BOOT-device.
(The BL in the first post was a keyboard error I think )
On start up
EBX = 0x06540020
I do not know what it is. I just found some text BOOTIMG. Is it something usefull in this case??
Computer says NOOOO
Re: DETECT BOOTING FROM USB
Right. I assumed he wanted to load the kernel from the USB disk and that could be done from within the bootloader(before entering protected mode, of course). So I just gave a hint. Didn't read enough of his post and whole thing turned out to be stupid, lol.gerryg400 wrote:You can't use Bios services in 32 bit mode. You need to write your own drivers. I'm sure that Chandra knows that, I think he just didn't read your question correctly.
Edit: hey, I didn't quote that 'read from protected mode' part. I must have seriously missed it. Or was the original post edited?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: DETECT BOOTING FROM USB
Even if I used 80 stages of bootloaders I still need to know how to read/write from witch device when I do want to read/write.Chandra wrote:Right. I assumed he wanted to load the kernel from the USB disk and that could be done from within the bootloader(before entering protected mode, of course). So I just gave a hint. Didn't read enough of his post and whole thing turned out to be stupid, lol.gerryg400 wrote:You can't use Bios services in 32 bit mode. You need to write your own drivers. I'm sure that Chandra knows that, I think he just didn't read your question correctly.
Edit: hey, I didn't quote that 'read from protected mode' part. I must have seriously missed it. Or was the original post edited?
But I found the answer. Afther boot I first call INT 0x13 function AH=0x48.
In [DS:SI] I found the drive parameters I need:
- Drive is USB/ATA/ATAPI/SCSI/etc.
- Even parameters about the connection DMA, IRQ and supported functions/options.
Afther that I know what to do afther switching to PMODE.
I hope version v2.0+ and v3.0 is supported well on today's computers.
Thanks anyway.
Last edited by Holus on Fri Oct 07, 2011 12:10 am, edited 1 time in total.
Computer says NOOOO
Re: DETECT BOOTING FROM USB
You should use function 48h. I have no USB drivers yet for my OS but I can get info that boot device has USB interface. Here is example:Holus wrote:If I boot from USB register DL=0x80 just like booting from HDD.
That is the point. If I finished my drivers for USB in 2023 I still need to know what drivers I have to use to read from the BOOT-device.
Code: Select all
size: 32
part: 1
type: 0
extra: 0
bus type: PCI
interface type: USB
interface: 00 00 00 00 00 00 00 00 ; PCI 0:0:0 (?), channel 0
device: 88 00 00 00 00 00 00 00
I don't know too.On start up
EBX = 0x06540020
I do not know what it is.
If you have seen bad English in my words, tell me what's wrong, please.
Re: DETECT BOOTING FROM USB
Thanks!!!egos wrote:You should use function 48h. I have no USB drivers yet for my OS but I can get info that boot device has USB interface. Here is example:Holus wrote:If I boot from USB register DL=0x80 just like booting from HDD.
That is the point. If I finished my drivers for USB in 2023 I still need to know what drivers I have to use to read from the BOOT-device.Code: Select all
size: 32 part: 1 type: 0 extra: 0 bus type: PCI interface type: USB interface: 00 00 00 00 00 00 00 00 ; PCI 0:0:0 (?), channel 0 device: 88 00 00 00 00 00 00 00
I don't know too.On start up
EBX = 0x06540020
I do not know what it is.
I just found the way to pull this off.
I'm a starter in this and I just tricked by int 0x13 with 64bit addressing support. Why te support if you can't use it in 32bit or 64bit.
Computer says NOOOO
Re: DETECT BOOTING FROM USB
Now i see the light I think I start over and reverse engeneer my OS from BIOS.
BIOS knows all the main functions that te computer need before I make the HAL (hardware abstraction layer) I need some main functions to process it.
http://www.delorie.com/djgpp/doc/rbinter/id/21/7.html
BIOS knows all the main functions that te computer need before I make the HAL (hardware abstraction layer) I need some main functions to process it.
http://www.delorie.com/djgpp/doc/rbinter/id/21/7.html
Computer says NOOOO
Re: DETECT BOOTING FROM USB
At some future date, when you have a working operating system, making a USB drive bootable will presumably be something to be performed by the operating system, or at least by the shell. As part of that function it could write a signature into the boot loader for the relevant device; indicating it to be a CD, USB drive, or whatever. With that thought in mind, you could start putting signatures into your boot loaders as of today.gerryg400 wrote:No I don't think there is a simple solution. But since you have IDE you can now implement a USB stack.Holus wrote:The IDE driver is working. With some help on OSDEV and GOOGLE.
I hoped there was some simple sollution becouse it starts so nice and easy just like a HDD.
Do you know how to find out you booted from USB-flash drive and not from HDD?
Did you look in DL ? Your original post says BL.