n the init_floppy routine, trying to re-calibrate... I am using the first drive...
so I send the cmd and drive # to the FDC, got stuck in the infinite loop that is
supposed to exit upon irq6 interrupt... what could go wrong here?
I have made a few checks. eflag's irq enable bit is on...
also the previous times the interrupt and irq routine works... (as I reset FDC by
writing a zero to DOR)...
any suggestions??
My code snippet below, I got stuck in the while loop
Code:
int st0, cy1;
floppy_motor(1);
print("start the timer \n");
//magic();
//exec(run_floppy_timer);
inti=0;for(i=0;i<10;i++){floppy_write_cmd(RECALIBERATE); // 7floppy_write_cmd(1); // select first drive//irq6=1;//sti();while(irq6);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is not a Bochs bug, since the recalibrate command raises IRQ 6 as expected. The comment in the code says that you want to select the first drive (Linux /dev/fd0 / DOS/Windows A:), but send the command to drive #1. The values for the drive selection in DOR and floppy command are different. Please change the 1in the command to 0 and try again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ok, my toy OS has 2 floppy, both 1.44mb, I am trying to initialize the second one...which is formatted as fat12.
Now DOR's last 2 bits selects the drive.. so the DOR should be set to 0x0d (dma 1, reset 1, dsel 1)
write 0 to DOR then write 0x0d to it, I received the first interrupt..
there are a couple of things like setting data rate and specify the step rate and head unload/load
now I can turn on the motor by writing 0x2d to 0x3f2 (DOR), wait for 500ms, then I issue command recalibrate , first input is 1 (which selects the first drive) ... now I am supposed to receive another interrupt... I am stuck there!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created a compressed zip file that contains everything I got with my OS, if you have a linux machine, just have to run the bochs script... to do that
1. unzip
2. cd into the directory that is generated by the unzip command
3. run this single command
(cd src; make clean; make all); ./update_image.sh; ./run_bochs.sh
I have tried to reset fdc twice, both times triggered the interrupt, no interrupt is triggered by recalibrate. I have tried to recalibrate without floppy reset, I got the interrupt!!!
Last edit: jimmy zhang 2020-11-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
n the init_floppy routine, trying to re-calibrate... I am using the first drive...
so I send the cmd and drive # to the FDC, got stuck in the infinite loop that is
supposed to exit upon irq6 interrupt... what could go wrong here?
I have made a few checks. eflag's irq enable bit is on...
also the previous times the interrupt and irq routine works... (as I reset FDC by
writing a zero to DOR)...
any suggestions??
My code snippet below, I got stuck in the while loop
Code:
int st0, cy1;
floppy_motor(1);
print("start the timer \n");
//magic();
//exec(run_floppy_timer);
This is not a Bochs bug, since the recalibrate command raises IRQ 6 as expected. The comment in the code says that you want to select the first drive (Linux /dev/fd0 / DOS/Windows A:), but send the command to drive #1. The values for the drive selection in DOR and floppy command are different. Please change the 1in the command to 0 and try again.
ok, my toy OS has 2 floppy, both 1.44mb, I am trying to initialize the second one...which is formatted as fat12.
Now DOR's last 2 bits selects the drive.. so the DOR should be set to 0x0d (dma 1, reset 1, dsel 1)
write 0 to DOR then write 0x0d to it, I received the first interrupt..
there are a couple of things like setting data rate and specify the step rate and head unload/load
now I can turn on the motor by writing 0x2d to 0x3f2 (DOR), wait for 500ms, then I issue command recalibrate , first input is 1 (which selects the first drive) ... now I am supposed to receive another interrupt... I am stuck there!!!
Do you have a bootable image that I can test here? Otherwise it's hard to find out what's going wrong.
I created a compressed zip file that contains everything I got with my OS, if you have a linux machine, just have to run the bochs script... to do that
1. unzip
2. cd into the directory that is generated by the unzip command
3. run this single command
(cd src; make clean; make all); ./update_image.sh; ./run_bochs.sh
Last edit: jimmy zhang 2020-11-16
I have tried to reset fdc twice, both times triggered the interrupt, no interrupt is triggered by recalibrate. I have tried to recalibrate without floppy reset, I got the interrupt!!!
Last edit: jimmy zhang 2020-11-16