floppy in pmode
Re:floppy in pmode
i found that my start motor also fails, and bochs doesn't care if it is on or off
p.s. does any one know a place to put code online free (not sourcefourge ???
p.s. does any one know a place to put code online free (not sourcefourge ???
Re:floppy in pmode
Any free host, like mine at www.asmhackers.net
Re:floppy in pmode
If code like that fails, then ever your floppy is fault or your using a usb floppy drive or it does not get call in your code??.GLneo wrote: i found that my start motor also fails, and bochs doesn't care if it is on or off
Or you could try ;
Code: Select all
void start_motor()
{
outport(0x372, 0x1C);
delay(1);
}
Re:floppy in pmode
ok, i've got time in betwing all statments and it worked!, but after a few minetes of delays what doesn't and what does need time sensitivity ???, thx
Re:floppy in pmode
Look at the code fdd.asm, look for this bit of code:
It may now always be"5" it could be "1" or "20" etc.
You should know what your timer is compared to a second (eg: 18.2) = a second etc, now put the same delay in as is in my code at the same place in your code.
Note: One of the most critical timing things is that from starting the floppy motor, it need to get up to speed, so set this to 1 second for now, from starting to moving on to the rest of the code.
Code: Select all
mov [Timer],5 ; 5 = 250us or 20 = 1 second.
You should know what your timer is compared to a second (eg: 18.2) = a second etc, now put the same delay in as is in my code at the same place in your code.
Note: One of the most critical timing things is that from starting the floppy motor, it need to get up to speed, so set this to 1 second for now, from starting to moving on to the rest of the code.
Re:floppy in pmode
i was working on a read_sector based on Dex4u driver, here is all code:
bochs says:
Code: Select all
void floppy_read_sector(unsigned char *buf, int pos)
{
int sec, cyl, head;
sec = (pos % 18) + 1;
cyl = (pos / 18) / 2;
head = pos % 2;
if(motor_on == 0)
{
start_motor();
motor_on = 1;
}
outport((base_used + 0x7), 0);
set_dma(buf, 512);
send_byte(0xE6);
send_byte(0x00);
send_byte((unsigned char)cyl);
send_byte((unsigned char)head);
send_byte((unsigned char)sec);
send_byte(0x02);
send_byte(0x12);
send_byte(0x1B);
send_byte(0xFF);
wait_irq6();
(void)get_byte();
(void)get_byte();
(void)get_byte();
(void)get_byte();
(void)get_byte();
(void)get_byte();
(void)get_byte();
}
Code: Select all
void set_dma(char *buff, short size)
{
char page;
short offset;
page = (char)((int)buff >> 16);
???offset = (short)((int)buff & 0xFFFF);
outport(0x0A, 6);
outport(0x0B, 70);
outport(0x0C, 1);
outport(0x04, offset | 0xFF);
outport(0x04, offset >> 4);
outport(0x81, page);
outport(0x0C, 1);
outport(0x05, size | 0xFF);
outport(0x05, size >> 4);
outport(0x0A, 2);
}
Code: Select all
00350430685e[FDD ] head number in command[1] doesn't match head field
Re:floppy in pmode
the motor wasn't on, but now the dma has problems:
Code: Select all
00980630292e[DMA ] write to command register: value(10h) not 0x00
00985368858e[FDD ] head number in command[1] doesn't match head field
Re:floppy in pmode
ok, i've fixed the previous problem, but a new one:
the old code is the same exept:
over the old converter
Code: Select all
00391632969p[CPU ] >>PANIC<< bound: op2 must be memory reference
00391665829e[DEV ] write to port 0x03d5 with len 4 ignored
00391665950p[CPU ] >>PANIC<< prefetch: running in bogus memory
Code: Select all
sec = (pos % 18) + 1;
cyl = (pos / 18) / 2;
head = cyl % 2;
Re:floppy in pmode
I don't know whether or not this will help, my code for LBA to CHS Conversion looks like:(The casts are there because Offset is 64bit, just disregard them) - This code is used by my bootloader for calculating the parameters for the BIOS INT 13h service but it looks like it should work the same, I'm not an expert on the FDC though.
Code: Select all
Sector = (static_cast<UINT32>(Offset) % volume->Parent->Sectors) + 1;
Cylinder = (static_cast<UINT32>(Offset) / volume->Parent->Sectors) / volume->Parent->Heads;
Head = (static_cast<UINT32>(Offset) / volume->Parent->Sectors) % volume->Parent->Heads;
Re:floppy in pmode
Hi!
GLneo: can you tell me, how do you fix the "head number in command[1] doesn't match head field" Problem?
Thank you!
GLneo: can you tell me, how do you fix the "head number in command[1] doesn't match head field" Problem?
Thank you!