MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / floppy_read_cmd

Function floppy_read_cmd

bsp/x86/drivers/floppy.c:214–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212
213
214void floppy_read_cmd(u32 blk)
215{
216 u32 head;
217 u32 track;
218 u32 sector;
219
220 block_to_hts(blk,&head,&track,&sector);
221
222 floppy_motorOn();
223 io_delay();
224
225 floppy_setupDMA();
226 io_delay();
227
228 floppy_setmode();
229 io_delay();
230 floppy_sendbyte (FD_READ); //send read command
231 floppy_sendbyte (head*4 + 0);
232 floppy_sendbyte (track); /* Cylinder */
233 floppy_sendbyte (head); /* Head */
234 floppy_sendbyte (sector); /* Sector */
235 floppy_sendbyte (2); /* 0=128, 1=256, 2=512, 3=1024, ... */
236 floppy_sendbyte (18);
237 //floppy_sendbyte (sector+secs-1); /* Last sector in track:here are sectors count */
238 floppy_sendbyte (0x1B);
239 floppy_sendbyte (0xff);
240 return;
241}
242
243static struct rt_device devF;
244static struct rt_mutex lock;

Callers 1

rt_floppy_readFunction · 0.85

Calls 5

block_to_htsFunction · 0.85
floppy_motorOnFunction · 0.85
floppy_setupDMAFunction · 0.85
floppy_setmodeFunction · 0.85
floppy_sendbyteFunction · 0.85

Tested by

no test coverage detected