aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs/dev.h
blob: 40263e67d1c77c254e62c0140fbd8c882d576308 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef MELVIX_DEV_H
#define MELVIX_DEV_H

#include <stdint.h>
#include <kernel/fs/vfs.h>

struct dev {
	char name[128];
	uint32_t block_size;
	read read;
	write write;

	uint8_t bus;
	uint8_t drive;
};

void dev_make(char *name, read read, write write);
uint32_t dev_read(struct fs_node *dev, uint32_t offset, uint32_t size, char *buffer);
uint32_t dev_write(struct fs_node *dev, uint32_t offset, uint32_t size, char *buffer);

void dev_stdout();
void dev_stdin();
void dev_stderr();

#endif