GitOS
Operating system exercise
|
Go to the source code of this file.
Data Structures | |
struct | disk_stream |
Functions | |
int | diskstreamer_read (struct disk_stream *stream, void *out, int total) |
Reads specified amount of bytes into buffer. | |
int | diskstreamer_seek (struct disk_stream *stream, int pos) |
Seeks into specified offset in stream. | |
struct disk_stream * | diskstreamer_new (int disk_id) |
Allocates and sets up new disk_stream struct. | |
void | diskstreamer_close (struct disk_stream *stream) |
Frees allocated disk_stream. | |
void diskstreamer_close | ( | struct disk_stream * | stream | ) |
struct disk_stream * diskstreamer_new | ( | int | disk_id | ) |
Allocates and sets up new disk_stream struct.
disk_id | Disk ID |
References disk_stream::disk, disk_get(), kzalloc(), and disk_stream::pos.
int diskstreamer_read | ( | struct disk_stream * | stream, |
void * | out, | ||
int | total | ||
) |
Reads specified amount of bytes into buffer.
stream | Stream to read |
out | Target buffer |
total | Total amount of bytes to read |
References assert, disk_stream::disk, disk_read_block(), DISK_SECTOR_SIZE, offset, and disk_stream::pos.
int diskstreamer_seek | ( | struct disk_stream * | stream, |
int | pos | ||
) |
Seeks into specified offset in stream.
stream | Stream to seek |
pos | Bytes from 0 |
References disk_stream::pos.