|
tape-kernel 1.0
a modular modern independent kernel
|
#include "../lib/types.h"

Go to the source code of this file.
Macros | |
| #define | IDE_DATA 0x1F0 |
| #define | IDE_PRIMARY_CONTROL 0x3F6 |
| #define | IDE_ERROR 0x1F1 |
| #define | IDE_SECTORS 0x1F2 |
| #define | IDE_LBA_LOW 0x1F3 |
| #define | IDE_LBA_MID 0x1F4 |
| #define | IDE_LBA_HIGH 0x1F5 |
| #define | IDE_DEVICE 0x1F6 |
| #define | IDE_COMMAND 0x1F7 |
| #define | IDE_STATUS 0x1F7 |
| #define | ideinit __ideinit |
| #define | irsec __irsec |
| #define | iwrt __iwrt |
| #define | idesize __idesize |
Functions | |
| void | __ideinit (void) |
| ideinit initializes the ide disk controller | |
| void | __irsec (uint32_t lba, uint8_t *buff) |
| irsec reads a single 512 byte sector from disk | |
| void | __iwrt (uint32_t lba, uint8_t *buff) |
| iwrt writes a single 512 byte sector to disk | |
| int | __idesize (uint32_t *secs) |
| idesize queries the ide drive for its total sector count | |
| #define IDE_COMMAND 0x1F7 |
Definition at line 14 of file ide.h.
Referenced by __idesize(), __irsec(), and __iwrt().
| #define IDE_DATA 0x1F0 |
Definition at line 6 of file ide.h.
Referenced by __idesize(), __irsec(), and __iwrt().
| #define IDE_DEVICE 0x1F6 |
Definition at line 13 of file ide.h.
Referenced by __ideinit(), __idesize(), __irsec(), and __iwrt().
| #define IDE_LBA_HIGH 0x1F5 |
| #define IDE_LBA_LOW 0x1F3 |
| #define IDE_LBA_MID 0x1F4 |
| #define IDE_PRIMARY_CONTROL 0x3F6 |
Definition at line 7 of file ide.h.
Referenced by __ideinit().
| #define IDE_SECTORS 0x1F2 |
| #define IDE_STATUS 0x1F7 |
Definition at line 15 of file ide.h.
Referenced by __ideinit(), __idesize(), __irsec(), and __iwrt().
| #define idesize __idesize |
Definition at line 20 of file ide.h.
Referenced by __disksize().
| #define irsec __irsec |
Definition at line 18 of file ide.h.
Referenced by ___init(), __ffsinit(), __fsinit(), __fsread(), __fsreadb(), and cmd_readfile().
| #define iwrt __iwrt |
Definition at line 19 of file ide.h.
Referenced by ___init(), __ffsinit(), __fsadd(), __fsdelete(), __fswrite(), __fswriteb(), and cmd_writefile().
| void __ideinit | ( | void | ) |
ideinit initializes the ide disk controller
ideinit is a function that resets the ide controller, selects the master drive, and verifies the drive is present and ready
using ideinit is done with
Definition at line 21 of file ide.c.
References assert, IDE_DEVICE, IDE_PRIMARY_CONTROL, IDE_STATUS, inb, and outb.
| int __idesize | ( | uint32_t * | secs | ) |
idesize queries the ide drive for its total sector count
idesize is a function that sends the IDENTIFY command to the ide drive and reads back the total number of lba28 sectors
| secs,a | pointer to store the total sector count |
using idesize is done with
Definition at line 144 of file ide.c.
References IDE_COMMAND, IDE_DATA, IDE_DEVICE, IDE_STATUS, inb, inw, and outb.
irsec reads a single 512 byte sector from disk
irsec is a function that reads one sector from the ide drive at the given lba
| lba,the | logical block address to read from |
| buff,the | 512 byte buffer to store the read data |
using irsec is done with
Definition at line 59 of file ide.c.
References assert, IDE_COMMAND, IDE_DATA, IDE_DEVICE, IDE_LBA_HIGH, IDE_LBA_LOW, IDE_LBA_MID, IDE_SECTORS, IDE_STATUS, inb, inw, NULL, and outb.
iwrt writes a single 512 byte sector to disk
iwrt is a function that writes one sector to the ide drive at the given lba
| lba,the | logical block address to write to |
| buff,the | 512 byte buffer containing the data to write |
using iwrt is done with
Definition at line 99 of file ide.c.
References assert, IDE_COMMAND, IDE_DATA, IDE_DEVICE, IDE_LBA_HIGH, IDE_LBA_LOW, IDE_LBA_MID, IDE_SECTORS, IDE_STATUS, inb, NULL, outb, and outw.