MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / writecmd

Method writecmd

src/fs/ata.rs:370–394  ·  view source on GitHub ↗

WRITE COMMAND

(&mut self, cmd: Command)

Source from the content-addressed store, hash-verified

368
369 // WRITE COMMAND
370 fn writecmd(&mut self, cmd: Command) -> Result<(), ()>
371 {
372 unsafe
373 {
374 self.cmd_reg.write(cmd as u8)
375 }
376
377 // Wait for 400 nanoseconds
378 self.wait(400);
379
380 // Ignore first read
381 self.status();
382 self.clrintr();
383
384 // If drive does not exist
385 if self.status() == 0
386 {
387 return Err(());
388 }
389
390 self.poll(Status::BUSY, false)?;
391 self.poll(Status::DRQ, true)?;
392
393 Ok(())
394 }
395
396
397 // WRITE COMMAND PARAMETERS

Callers 3

id_driveMethod · 0.80
readMethod · 0.80
writeMethod · 0.80

Calls 6

waitMethod · 0.80
statusMethod · 0.80
clrintrMethod · 0.80
ErrEnum · 0.50
writeMethod · 0.45
pollMethod · 0.45

Tested by

no test coverage detected