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

Method write_cmd_params

src/fs/ata.rs:398–418  ·  view source on GitHub ↗

WRITE COMMAND PARAMETERS

(&mut self, drive: u8, blk: u32)

Source from the content-addressed store, hash-verified

396
397 // WRITE COMMAND PARAMETERS
398 fn write_cmd_params(&mut self, drive: u8, blk: u32) -> Result<(), ()>
399 {
400 let lba = true;
401 let mut bytes = blk.to_le_bytes();
402
403 bytes[3].set_bit(4, drive > 0);
404 bytes[3].set_bit(5, true);
405 bytes[3].set_bit(6, lba);
406 bytes[3].set_bit(7, true);
407
408 unsafe
409 {
410 self.sectcount_reg.write(1);
411 self.lba0_reg.write(bytes[0]);
412 self.lba1_reg.write(bytes[1]);
413 self.lba2_reg.write(bytes[2]);
414 self.drive_reg.write(bytes[3]);
415 }
416
417 Ok(())
418 }
419}
420
421

Callers 2

id_driveMethod · 0.80
setup_pioMethod · 0.80

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected