Crates.io | ata_x86 |
lib.rs | ata_x86 |
version | 0.1.1 |
source | src |
created_at | 2023-02-24 16:58:47.820009 |
updated_at | 2023-02-24 17:09:52.82864 |
description | All credit goes to NPEX42, I made this since the operating system I've been working on breaks When the x86_64 crate is imported and this removes it. A Simple, Amazing x86 ATA Crate. Credit to NPEX42 |
homepage | |
repository | |
max_upload_size | |
id | 793768 |
size | 19,868 |
All credit goes to NPEX42, I made this since the operating system I've been working on breaks \nWhen the x86_64 crate is imported and this removes it. A Simple, Amazing x86 ATA Crate. Credit to NPEX42
// Read A Single block from a disk
pub fn read_single() {
use ata_x86::{init, ATA_BLOCK_SIZE, read};
// 1. Initialise ATA Subsystem. (Perform Once, on boot)
init().expect("Failed To Start ATA...");
// 2. Create a temporary buffer of size 512.
let mut buffer: [u8;ATA_BLOCK_SIZE] = [0; ATA_BLOCK_SIZE];
// 3. Pass the buffer over to the Subsystem, to be filled.
read(0, 0, 0, &mut buffer);
}
// Write A Single block onto a disk
pub fn write_single() {
use ata_x86::{init, ATA_BLOCK_SIZE, write};
// 1. Initialise ATA Subsystem. (Perform Once, on boot)
init().expect("Failed To Start ATA...");
// 2. Create a buffer of size 512, filled with the data to be written.
let buffer: [u8;ATA_BLOCK_SIZE] = [0; ATA_BLOCK_SIZE];
// 3. Pass the buffer over to the Subsystem, to be filled.
write(0, 0, 0, &buffer);
}