Page 2 of 2
Posted: Fri Oct 26, 2007 3:15 am
by darklight
Thanks everybody that heard my voice )))
I want to talk about simulation.
Simulation is doing BIOS. But can Windows do simulation? If yes, I think that it doing by another way, isn't it? If so, whence can I know how many heads, etc. simulates BIOS??? If I'm reading by LBA there is no problem. But I don't think so...
And please tell me how can I access Flash Disk through LBA?(or give a link to tutorial)
Here is the BPB generated by Windows Formatter:
Code: Select all
4D 53 44 4F 53 35 2E 30 00 02 20 04 00 02 00 02 00 00 F8 F2 00 3F 00 FF 00 3F 00 00 00 C1 3B 1E 00 00 00 29 F0 18 71 FC 4E 4F 20 4E 41 4D 45 20 20 20 20 46 41 54 31 36 20 20 20
Here is partition table:
Code: Select all
80 01 01 00 06 FE 3F 7A 3F 00 00 00 C1 3B 1E 00 00 00
P.S. I know that in my code is a logical bug))), and thanks to Dex for links
And my bootloader(nasm -f bin ....)(I'm replaceing only first needed bytes of sector with my bootloader):
Posted: Fri Oct 26, 2007 3:45 am
by Dex
Candy wrote:Dex wrote:Yes it users CHS, but i can not understand the problem ?, do you want to know the "how many cylinders, heads, heads per cylinder, tracks per head, sectors per track" for your USB fob if so, do as i pointed out above to this:
You only answer the subset where the USB disk is FAT16 formatted and not partitioned - half the disks I've had were partitioned and I've regularly formatted them with something else (ext3, ntfs, *fs) which all don't happen to have a BPB.
Any ideas on how to do it other than reading nonpresent information in a specific file system?
Your right candy, but in my defence, the available info in his partion table, pointed to the first partion be bootable and fat16.
But for his real bootloader, he would need to do more.
Posted: Fri Oct 26, 2007 2:33 pm
by darklight
Has anybody seen my code? (sorry for short question)
Posted: Fri Oct 26, 2007 4:34 pm
by os64dev
nope(sorry for short answer)
Posted: Fri Oct 26, 2007 5:42 pm
by Dex
Yes, where do you popa here ?
Code: Select all
pusha ; This is the pusha, but wheres the popa ?
mov bp, loaded
mov ax, 0x1301
mov bx, 7
mov cx, 10
mov dx, 0x0302
int 0x10
;call waitkey
jmp 0x0000:0x1000
Posted: Sat Oct 27, 2007 8:16 am
by darklight
LOOOL(I forgot to place there). But I tried and with popa but IT IS NOT WORKING. I think that problem is in int 13h ah=2. How can I use lba? I've read somwhere that int 13h have ah=0x4 function that is using lba. But when I read The Art of Assembly Language, there was written, that ah=4 func is doing anything else(I can't remember that).
Posted: Sat Oct 27, 2007 10:05 am
by elderK
Hey Darklight, This question interested me so, I did some searching around online and this, so far, this is the only nugget of glee I could find...
Hopefully it helps out.
http://www.ctyme.com/intr/rb-0677.htm
~Z
Posted: Sat Oct 27, 2007 12:58 pm
by Dex
darklight wrote:LOOOL(I forgot to place there). But I tried and with popa but IT IS NOT WORKING. I think that problem is in int 13h ah=2. How can I use lba? I've read somwhere that int 13h have ah=0x4 function that is using lba. But when I read The Art of Assembly Language, there was written, that ah=4 func is doing anything else(I can't remember that).
I think that should be
IBM/MS extended BIOS disk services (INT 13h services 4?h)
As in this link
http://freedos-32.sourceforge.net/showd ... e=biosdisk
Try int 13h ah = 42h or 43h or 48h etc, See here:
http://www.ctyme.com/intr/rb-0708.htm#Table272
[EDIT] This may help you
Posted: Sat Oct 27, 2007 4:39 pm
by 1234
[post deleted]
Posted: Sat Oct 27, 2007 8:55 pm
by Dex
mikegonta wrote:
- offset 3 (OEM ID) must be db "NTFS"
or
- offset 24 (Sectors Per Track) must be non zero
offset 26 (Number Of Heads) must be non zero
offset 53 (File System Type) must be db "FAT"
I haven't tried all possible file system acronyms, but it seems strange that the bios would require a file system identifier in order for the media to be bootable.
Mike Gonta
I have know idea if this is true, but it make sence, as i have alway found that formating the fob + add sys files under windows, works best for booting from usb fobs.
Posted: Sun Oct 28, 2007 7:22 am
by darklight
Hi people. I have successfully booted from usb. I have played with int 13h AH=2 function parameters and it worked. I think that between floopy and hdd simulation the difference is very small))) My BIOS is simulating as hdd and also as floppy. I tried without declaring partition table, and with declaring partition table, both are working!!!
Thanks every body for information and help! See you later...
Posted: Sun Oct 28, 2007 11:14 am
by JAAman
darklight wrote:Hi people. I have successfully booted from usb. I have played with int 13h AH=2 function parameters and it worked. I think that between floopy and hdd simulation the difference is very small))) My BIOS is simulating as hdd and also as floppy. I tried without declaring partition table, and with declaring partition table, both are working!!!
Thanks every body for information and help! See you later...
the bios doesnt care if there is a partition table or not -- the bios will quite happily boot a FDD with a partition table, or a HDD without one...
the only difference between FDD emulation and HDD emulation, is that the later will allow you to use the HDD bios calls (which can use either CHS or LBA) and FDD emulation will only use the FDD bios call (which cannot use LBA, iirc)
for information on the bios calls (including the LBA calls) check the ultimate BIOS call reference -- the RBIL --
http://www.cs.cmu.edu/~ralf/files.html -- there is a online version, but i seem to have lost my link to it...