ay&t

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
frank

ay&t

Post 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)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:ay&t

Post 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 ...
frank

Re:ay&t

Post 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....
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:ay&t

Post 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.
Post Reply