feat: added cross compiler and moved headers to include dir
This commit is contained in:
71
include/fs/blockdev.h
Normal file
71
include/fs/blockdev.h
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// Created by rick on 06-02-21.
|
||||
//
|
||||
|
||||
#ifndef NEW_KERNEL_BLOCKDEV_H
|
||||
#define NEW_KERNEL_BLOCKDEV_H
|
||||
|
||||
#include <types.h>
|
||||
#include <driver.h>
|
||||
|
||||
#define BLOCK_DEV_ACCESS_OK 0
|
||||
#define BLOCK_DEV_ACCESS_ERR 1
|
||||
|
||||
#define BLOCK_DEV_DIRECTION_READ 0
|
||||
#define BLOCK_DEV_DIRECTION_WRITE 1
|
||||
|
||||
#define BLOCK_DEV_DRIVER_CHECK_OK 0
|
||||
#define BLOCK_DEV_DRIVER_CHECK_NO_MATCH 1
|
||||
|
||||
#define BLOCK_DEV_REGISTER_DRIVER_OK 0
|
||||
#define BLOCK_DEV_REGISTER_DRIVER_FULL 1
|
||||
|
||||
#define BLOCK_DEV_REGISTER_OK 0
|
||||
#define BLOCK_DEV_REGISTER_FULL 1
|
||||
|
||||
|
||||
typedef struct block_device block_device;
|
||||
|
||||
typedef uint8_t (*block_device_driver_check_device)(const block_device *device, uint8_t *first_sector);
|
||||
|
||||
typedef uint8_t (*block_device_driver_free)(const block_device *device);
|
||||
|
||||
typedef uint8_t (*block_device_access)(const block_device *device, uint8_t direction, uint32_t lba, uint8_t sectors, void *target);
|
||||
|
||||
struct block_dev_driver {
|
||||
char name[16];
|
||||
struct {
|
||||
uint8_t root_only: 1;
|
||||
} flags;
|
||||
block_device_driver_check_device check_device;
|
||||
block_device_driver_free free_device;
|
||||
} __attribute__((__aligned__(STRUCT_ALIGNMENT)));
|
||||
|
||||
#define BLOCK_DEV_DRIVER(order) GENERIC_DRIVER(block_dev_driver, order)
|
||||
|
||||
typedef struct block_device {
|
||||
struct {
|
||||
uint8_t present: 1;
|
||||
uint8_t scanned: 1;
|
||||
uint8_t unreadable: 1;
|
||||
uint8_t root_device: 1;
|
||||
uint8_t driver_installed: 1;
|
||||
} flags;
|
||||
char identifier[16];
|
||||
uint32_t num_lba;
|
||||
uint16_t block_size;
|
||||
block_device_access access;
|
||||
struct block_dev_driver *driver;
|
||||
void *device_info; // pointer to driver defined structure
|
||||
// todo device info
|
||||
} block_device;
|
||||
|
||||
uint8_t block_dev_register(block_device *device);
|
||||
|
||||
void block_dev_free(block_device *device);
|
||||
|
||||
void block_dev_start_task();
|
||||
|
||||
void block_dev_print_info();
|
||||
|
||||
#endif //NEW_KERNEL_BLOCKDEV_H
|
||||
8
include/fs/fat.h
Normal file
8
include/fs/fat.h
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by rick on 07-02-21.
|
||||
//
|
||||
|
||||
#ifndef NEW_KERNEL_FAT_H
|
||||
#define NEW_KERNEL_FAT_H
|
||||
|
||||
#endif //NEW_KERNEL_FAT_H
|
||||
12
include/fs/mbr.h
Normal file
12
include/fs/mbr.h
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Created by rick on 06-02-21.
|
||||
//
|
||||
|
||||
#ifndef NEW_KERNEL_MBR_H
|
||||
#define NEW_KERNEL_MBR_H
|
||||
|
||||
#include <types.h>
|
||||
|
||||
void mbr_read_from_ide(uint8_t ide_drive);
|
||||
|
||||
#endif //NEW_KERNEL_MBR_H
|
||||
Reference in New Issue
Block a user