If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Need help booting HDD2 with custom boot sector
In my environment I have written a custom boot sector on a CD (Win98SE) that
examines the partition table of the MBR and locates and loads the boot record of the active partition. I have 2 primary partitions and am able to selectively boot the OS on either partition. The problem I have is booting an OS on a second physical drive. I locate the boot record on the second drive and successfully load and execute the correct boot record but beyond that the OS that is on the corresponding partition of the first HDD loads instead. I must be missing something simple. Please help, I have to have this finished this week. |
#2
|
|||
|
|||
"Evan R. Hicks" wrote in message ... In my environment I have written a custom boot sector on a CD (Win98SE) that examines the partition table of the MBR and locates and loads the boot record of the active partition. I have 2 primary partitions and am able to selectively boot the OS on either partition. The problem I have is booting an OS on a second physical drive. I locate the boot record on the second drive and successfully load and execute the correct boot record but beyond that the OS that is on the corresponding partition of the first HDD loads instead. You may be loading IO.SYS from HD0. Try changing the drive designator byte in the volume boot sector, on the second hard drive (HD1) , at BPB + offset 0x40(FAT32) and/or offset 0x24(FAT) from 0x80 to 0x81. This byte is passed by the boot sector code to int 0x13 as the drive number for disk reads. Are you sure you're loading the boot sector on HD1? If not, you may need to change the "active bit" in the partition table to 0x81. Some stuff to read http://www.geocities.com/thestarman3...SWIN41.htm#BPB http://home.att.net/%7Erayknights/pc_boot/w98bboot.htm |
#3
|
|||
|
|||
"Bill Blanton" wrote: "Evan R. Hicks" wrote in message ... In my environment I have written a custom boot sector on a CD (Win98SE) that examines the partition table of the MBR and locates and loads the boot record of the active partition. I have 2 primary partitions and am able to selectively boot the OS on either partition. The problem I have is booting an OS on a second physical drive. I locate the boot record on the second drive and successfully load and execute the correct boot record but beyond that the OS that is on the corresponding partition of the first HDD loads instead. You may be loading IO.SYS from HD0. Try changing the drive designator byte in the volume boot sector, on the second hard drive (HD1) , at BPB + offset 0x40(FAT32) and/or offset 0x24(FAT) from 0x80 to 0x81. This byte is passed by the boot sector code to int 0x13 as the drive number for disk reads. Are you sure you're loading the boot sector on HD1? If not, you may need to change the "active bit" in the partition table to 0x81. Some stuff to read http://www.geocities.com/thestarman3...SWIN41.htm#BPB http://home.att.net/%7Erayknights/pc_boot/w98bboot.htm I updated the boot record of the OS on drive 2 and changed the drive number to 81h and now it attempts to load the OS (I get a flash of the splash screen) then an error message that says it cannot find the files on C:. Somewhere, the bios is still listing it as the second drive. I think this is where I need to change the order in my custom boot code before launching the boot sector. Anyone know where this table is created? |
#4
|
|||
|
|||
"Evan R. Hicks" wrote in message ...
"Bill Blanton" wrote: "Evan R. Hicks" wrote in message ... In my environment I have written a custom boot sector on a CD (Win98SE) that examines the partition table of the MBR and locates and loads the boot record of the active partition. I have 2 primary partitions and am able to selectively boot the OS on either partition. The problem I have is booting an OS on a second physical drive. I locate the boot record on the second drive and successfully load and execute the correct boot record but beyond that the OS that is on the corresponding partition of the first HDD loads instead. You may be loading IO.SYS from HD0. Try changing the drive designator byte in the volume boot sector, on the second hard drive (HD1) , at BPB + offset 0x40(FAT32) and/or offset 0x24(FAT) from 0x80 to 0x81. This byte is passed by the boot sector code to int 0x13 as the drive number for disk reads. Are you sure you're loading the boot sector on HD1? If not, you may need to change the "active bit" in the partition table to 0x81. I updated the boot record of the OS on drive 2 and changed the drive number to 81h and now it attempts to load the OS (I get a flash of the splash screen) then an error message that says it cannot find the files on C:. That answers that question,,PCR. Mabey Io.sys is hard coded to boot from the first drive? Somewhere, the bios is still listing it as the second drive. I think this is where I need to change the order in my custom boot code before launching the boot sector. You might want to study the source code for the grub loader. I've never used it, but Its map function apparently does what you want to do. http://gnu.mirror.widexs.nl/manual/g...#DOS%2fWindows Anyone know where this table is created? There are fixed disk tables in the bios data area(s). I know Phoenix used to document these. Ralf Brown's interrupt list contains a file called memory.lst that also documents the bios data areas. You might also have to deal with (swap?) the bios's controller I/O ports. Look at ports starting at 0170h and 01f0h. http://mudlist.eorbit.net/~adam/pickey/ports.html Sorry, not much help..you would probably have better luck asking in a group such as alt.os.development, or even an .asm group. Let me know if you figure it out. I'd be interested to know the mechanics of this.. |
#5
|
|||
|
|||
"Bill Blanton" wrote in message
... | "Evan R. Hicks" wrote in message ... | "Bill Blanton" wrote: | "Evan R. Hicks" wrote in message | ... | In my environment I have written a custom boot sector on a CD (Win98SE) that | examines the partition table of the MBR and locates and loads the boot record | of the active partition. I have 2 primary partitions and am able to | selectively | boot the OS on either partition. The problem I have is booting an OS on a | second physical drive. | | I locate the boot record on the second drive and successfully load and | execute the correct boot record but beyond that the OS that is on the | corresponding partition of the first HDD loads instead. | | You may be loading IO.SYS from HD0. Try changing the drive designator | byte in the volume boot sector, on the second hard drive (HD1) , at | BPB + offset 0x40(FAT32) and/or offset 0x24(FAT) from 0x80 to 0x81. | This byte is passed by the boot sector code to int 0x13 as the drive number | for disk reads. | | Are you sure you're loading the boot sector on HD1? If not, you may need | to change the "active bit" in the partition table to 0x81. | | I updated the boot record of the OS on drive 2 and changed the drive number | to 81h and now it attempts to load the OS (I get a flash of the splash | screen) then an error message that says it cannot find the files on C:. | | That answers that question,,PCR. Mabey Io.sys is hard coded to boot from | the first drive? Well, standard MS boot code likely wants x'81" there, if it is HDD1. But hasn't Hicks said he wrote his own code? Also, I'm thinking... BIOS must... also... allow it. (Or did we once decide it did not?) | | Somewhere, the bios is still listing it as the second drive. I think this | is where I need to change the order in my custom boot code before launching | the boot sector. | | You might want to study the source code for the grub loader. I've never used it, | but Its map function apparently does what you want to do. | http://gnu.mirror.widexs.nl/manual/g...#DOS%2fWindows | | Anyone know where this table is created? | | There are fixed disk tables in the bios data area(s). I know Phoenix used to | document these. Ralf Brown's interrupt list contains a file called memory.lst that | also documents the bios data areas. | | You might also have to deal with (swap?) the bios's controller I/O ports. Look at | ports starting at 0170h and 01f0h. | http://mudlist.eorbit.net/~adam/pickey/ports.html | | Sorry, not much help..you would probably have better luck asking in a group such | as alt.os.development, or even an .asm group. Let me know if you figure it out. I'd | be interested to know the mechanics of this.. -- Thanks or Good Luck, There may be humor in this post, and, Naturally, you will not sue, should things get worse after this, PCR |
#6
|
|||
|
|||
"PCR" wrote: "Bill Blanton" wrote in message ... | "Evan R. Hicks" wrote in message ... | "Bill Blanton" wrote: | "Evan R. Hicks" wrote in message | ... | In my environment I have written a custom boot sector on a CD (Win98SE) that | examines the partition table of the MBR and locates and loads the boot record | of the active partition. I have 2 primary partitions and am able to | selectively | boot the OS on either partition. The problem I have is booting an OS on a | second physical drive. | | I locate the boot record on the second drive and successfully load and | execute the correct boot record but beyond that the OS that is on the | corresponding partition of the first HDD loads instead. | | You may be loading IO.SYS from HD0. Try changing the drive designator | byte in the volume boot sector, on the second hard drive (HD1) , at | BPB + offset 0x40(FAT32) and/or offset 0x24(FAT) from 0x80 to 0x81. | This byte is passed by the boot sector code to int 0x13 as the drive number | for disk reads. | | Are you sure you're loading the boot sector on HD1? If not, you may need | to change the "active bit" in the partition table to 0x81. | | I updated the boot record of the OS on drive 2 and changed the drive number | to 81h and now it attempts to load the OS (I get a flash of the splash | screen) then an error message that says it cannot find the files on C:. | | That answers that question,,PCR. Mabey Io.sys is hard coded to boot from | the first drive? Well, standard MS boot code likely wants x'81" there, if it is HDD1. But hasn't Hicks said he wrote his own code? Also, I'm thinking... BIOS must... also... allow it. (Or did we once decide it did not?) | | Somewhere, the bios is still listing it as the second drive. I think this | is where I need to change the order in my custom boot code before launching | the boot sector. | | You might want to study the source code for the grub loader. I've never used it, | but Its map function apparently does what you want to do. | http://gnu.mirror.widexs.nl/manual/g...#DOS%2fWindows | | Anyone know where this table is created? | | There are fixed disk tables in the bios data area(s). I know Phoenix used to | document these. Ralf Brown's interrupt list contains a file called memory.lst that | also documents the bios data areas. | | You might also have to deal with (swap?) the bios's controller I/O ports. Look at | ports starting at 0170h and 01f0h. | http://mudlist.eorbit.net/~adam/pickey/ports.html | | Sorry, not much help..you would probably have better luck asking in a group such | as alt.os.development, or even an .asm group. Let me know if you figure it out. I'd | be interested to know the mechanics of this.. -- Thanks or Good Luck, There may be humor in this post, and, Naturally, you will not sue, should things get worse after this, PCR 9/10/2004 Since you wanted to know, I haven't gotten there yet but I researched the sites you suggested and bunch more for most of the day today. I discovered in the BIOS data area two locations that looked promising. 40:77 is port offset to hdd and 50:82 is the first hdd in the system. Both contained zero. I modified my boot code to change both locations to 1 if booting the second drive and it did not boot but it did act differently. Instead of crashing with error it just reboots. It is apparent that booting looks at those locations, they just don't have the correct values in them i presume. -- Research continues -- Evan |
#7
|
|||
|
|||
"Evan R. Hicks" wrote in message ...
9/10/2004 Since you wanted to know, I haven't gotten there yet but I researched the sites you suggested and bunch more for most of the day today. I discovered in the BIOS data area two locations that looked promising. 40:77 is port offset to hdd and 50:82 is the first hdd in the system. Both contained zero. I modified my boot code to change both locations to 1 if booting the second drive and it did not boot but it did act differently. Instead of crashing with error it just reboots. It is apparent that booting looks at those locations, they just don't have the correct values in them i presume. I think the 40:77 value in the BIOS data area are for older (mabey "XT") systems. The 00 offset may have been just a flag. (?) I found a couple of BIOS spec docs that might be more helpful- http://www.phoenix.com/en/customer+s...m_software.htm Look for "Enhanced Disk Drive Specification Version 1.1" (specs-edd11.pdf) and the "BIOS Boot Specification Version 1.01" (specs-bbs101.pdf) Section 4.1 and 4.2 of the "EDD spec" contains info about drive mapping and how to find the "Fixed Disk Parameter Table (FDPT). Mabey it is as easy as swapping the int 41h and int 46h interrupt vectors, and resetting the controllers? Of course you put 80h back in the boot sector. Be careful . I wouldn't let it boot to Windows. Windows writes all over the drive when it boots. I'd let it boot to DOS until you know it's working.. |
#8
|
|||
|
|||
"PCR" wrote in message ...
"Bill Blanton" wrote in message | That answers that question,,PCR. Mabey Io.sys is hard coded to boot from | the first drive? Well, standard MS boot code likely wants x'81" there, if it is HDD1. But hasn't Hicks said he wrote his own code? Also, I'm thinking... BIOS must... also... allow it. (Or did we once decide it did not?) I can't remember what we decided .. apparently (from the GRUB manual) Windows won't boot from HD1 and the drives have to be switched at the BIOS level.. |
#9
|
|||
|
|||
"Bill Blanton" wrote in message
... | "PCR" wrote in message ... | "Bill Blanton" wrote in message | | | That answers that question,,PCR. Mabey Io.sys is hard coded to boot from | | the first drive? | | Well, standard MS boot code likely wants x'81" there, if it is HDD1. But | hasn't Hicks said he wrote his own code? Also, I'm thinking... BIOS | must... also... allow it. (Or did we once decide it did not?) | | I can't remember what we decided .. apparently (from the GRUB manual) | Windows won't boot from HD1 and the drives have to be switched at the | BIOS level.. Oh. That must be why BING has "Swap"... ......Quote BootIt NG's .pdf................. The Swap column indicates whether or not the hard disk being booted will be swapped with HD0. To change swap options, select the item, and then each press of the F4 key cycles though the options for this column. (Alternatively, on the Item menu, click the appropriate option.) In other words, if you boot a partition on HD1 (the second hard disk) with the swap option on, then BootIt NG swaps that hard disk with HD0 so that HD1 is now HD0 and (the real) HD0 is now HD1. Keep in mind that, because swapping is done at the BIOS level, once an operating system boots in protected mode, it may ignore the BIOS and, in effect, undo the swap. ........End of quote of .pdf................. -- Thanks or Good Luck, There may be humor in this post, and, Naturally, you will not sue, should things get worse after this, PCR |
#10
|
|||
|
|||
"PCR" wrote: "Bill Blanton" wrote in message ... | "PCR" wrote in message ... | "Bill Blanton" wrote in message | | | That answers that question,,PCR. Mabey Io.sys is hard coded to boot from | | the first drive? | | Well, standard MS boot code likely wants x'81" there, if it is HDD1. But | hasn't Hicks said he wrote his own code? Also, I'm thinking... BIOS | must... also... allow it. (Or did we once decide it did not?) | | I can't remember what we decided .. apparently (from the GRUB manual) | Windows won't boot from HD1 and the drives have to be switched at the | BIOS level.. Oh. That must be why BING has "Swap"... ......Quote BootIt NG's .pdf................. The Swap column indicates whether or not the hard disk being booted will be swapped with HD0. To change swap options, select the item, and then each press of the F4 key cycles though the options for this column. (Alternatively, on the Item menu, click the appropriate option.) In other words, if you boot a partition on HD1 (the second hard disk) with the swap option on, then BootIt NG swaps that hard disk with HD0 so that HD1 is now HD0 and (the real) HD0 is now HD1. Keep in mind that, because swapping is done at the BIOS level, once an operating system boots in protected mode, it may ignore the BIOS and, in effect, undo the swap. ........End of quote of .pdf................. -- Thanks or Good Luck, There may be humor in this post, and, Naturally, you will not sue, should things get worse after this, PCR Here is the final resolution of this problem: There were five possibilities to solve this problem: 1) Physical drive identifier at offset 40h in boot record 2) Port offset to 1st HDD at 40:77 3) Identity of 1st HDD at 50:82 4) I/O port of HDD0 and HDD1 at 01F0h and 0170h respectively 5) Swapping vectors for Int41h and Int46h None worked. After studying the technical references from Phoenix I found that the first hard drive (80h) is hard coded into the BIOS and that it is the only drive the BIOS considers bootable. The only way to boot a different drive is to physically change it to 80h. That is done in NV memory only (CMOS). The first hard drive is the only hard drive listed in the IPL list. My solution (and it works) was to create two CMOS data files, one for each boot drive. When I need to boot the second drive I just install the appropriate data file and reboot. I do the same thing to change back. The only hurdle I had to jump over was that I store volatile date in some of the hidden sectors. Changing the order of the drives also changed the location of my data so I had to update the program to search all attached drives and find my data. This was easily accomplished by adding a signature to the last WORD of the sectors. Thank you both for your help. Evan R. Hicks Intel Corporation |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
W98 configmg error on W98/xp pro dual boot machine | RJK | General | 13 | August 13th 04 09:15 PM |
error message | bill | General | 7 | August 10th 04 02:09 AM |
No Info in Cofig.sys or Autoexec. | Ralph Jaggi | General | 84 | July 19th 04 09:44 PM |
Unwritable boot sector | Lee Byler | Disk Drives | 2 | July 9th 04 08:53 PM |
"no OS found | john | General | 3 | July 4th 04 07:50 PM |