Page 1 of 1

ay&t

Posted: Fri Aug 30, 2002 6:23 am
by frank
Why doesn't this:

Code: Select all

asm("mob %dl,%dl":"=d" (drive));
work?
I get this error:

Code: Select all

parse error before ":"
also, when you boot a partition, how does it know what the second sector is? (the bootblock)

Re:ay&t

Posted: Fri Aug 30, 2002 6:44 am
by Pype.Clicker
humm ... mob is not a valid opcode, i guess this is a typo of mov ...


anyway, mov dl, dl is not valid either. If what you want to do is storing the dl value in drive, try

Code: Select all

char drive;
asm ("movb %1,%dl":"=g"(drive));
optionnally,

Code: Select all

asm ("":"=d"(drive));
might work as well ...

Re:ay&t

Posted: Fri Aug 30, 2002 7:19 am
by frank
tnx it works :)

just checked the minix source, and I saw it reads the mbr to check in what sector it is...
but I can't find it in the linux source (reading mbr, 0.0.1)
also, when I put my ide cable on the other port linux doesn't boot... so I don't think it reads the mbr... perhaps it stores the stuff in the bootsector....

Re:ay&t

Posted: Fri Aug 30, 2002 7:47 am
by Pype.Clicker
frank wrote: tnx it works :)

just checked the minix source, and I saw it reads the mbr to check in what sector it is...
but I can't find it in the linux source (reading mbr, 0.0.1)
also, when I put my ide cable on the other port linux doesn't boot... so I don't think it reads the mbr... perhaps it stores the stuff in the bootsector....
uh ??? usually, only disk #1 is bootable by the BIOS. If you want to boot another disk than /dev/hda, you should normally put a multi-boot software on the Master Boot Record of drive /dev/hda which will load the kernel on another (defined in MBR or asked to the user) disk.