diff options
author | Marvin Borner | 2020-05-06 19:04:05 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-06 19:04:05 +0200 |
commit | d94ffac4a584dc7a4f6f2ec567b8caab05ce9253 (patch) | |
tree | 559cd596a0a407d4b40c1d12d3c6a0686494da16 /src/kernel/fs | |
parent | 1a8563a05608b5b5e27eada44cf4790926001c68 (diff) |
New build parameters and shared includes
This changes many files but I've just applied some replace commands.. So
- nothing special!
Diffstat (limited to 'src/kernel/fs')
-rw-r--r-- | src/kernel/fs/ata.c | 32 | ||||
-rw-r--r-- | src/kernel/fs/ata.h | 2 | ||||
-rw-r--r-- | src/kernel/fs/elf.c | 26 | ||||
-rw-r--r-- | src/kernel/fs/elf.h | 68 | ||||
-rw-r--r-- | src/kernel/fs/ext2.c | 90 | ||||
-rw-r--r-- | src/kernel/fs/ext2.h | 144 | ||||
-rw-r--r-- | src/kernel/fs/fs.c | 24 | ||||
-rw-r--r-- | src/kernel/fs/fs.h | 8 | ||||
-rw-r--r-- | src/kernel/fs/load.c | 10 | ||||
-rw-r--r-- | src/kernel/fs/load.h | 8 |
10 files changed, 206 insertions, 206 deletions
diff --git a/src/kernel/fs/ata.c b/src/kernel/fs/ata.c index 2146822..c7c7dc1 100644 --- a/src/kernel/fs/ata.c +++ b/src/kernel/fs/ata.c @@ -1,16 +1,16 @@ #include <stdint.h> #include <stddef.h> #include <stdbool.h> -#include <kernel/fs/ata.h> -#include <kernel/system.h> -#include <kernel/io/io.h> +#include <fs/ata.h> +#include <system.h> +#include <io/io.h> -static uint16_t sel_base_port = 0; -static uint8_t sel_master_or_slave = 0; +static u16 sel_base_port = 0; +static u8 sel_master_or_slave = 0; -static uint32_t max_sector; +static u32 max_sector; -static uint8_t read_stat(uint16_t base) +static u8 read_stat(u16 base) { inb(base + COM_STAT); inb(base + COM_STAT); @@ -20,7 +20,7 @@ static uint8_t read_stat(uint16_t base) return inb(base + COM_STAT); } -static void check_drive(uint16_t base, uint8_t master_or_slave) +static void check_drive(u16 base, u8 master_or_slave) { if (sel_base_port != 0) return; @@ -33,7 +33,7 @@ static void check_drive(uint16_t base, uint8_t master_or_slave) outb(base + LBA_HIGH, 0); outb(base + COM_STAT, IDENTIFY); - uint8_t stat = read_stat(base); + u8 stat = read_stat(base); if (stat == 0) return; @@ -47,8 +47,8 @@ static void check_drive(uint16_t base, uint8_t master_or_slave) if ((stat & ERR) != 0) return; - uint16_t drive_data[256]; - for (size_t i = 0; i < 256; i++) + u16 drive_data[256]; + for (u32 i = 0; i < 256; i++) drive_data[i] = inw(base + DATA); max_sector = drive_data[MAX_28LBA_SECTORS] | drive_data[MAX_28LBA_SECTORS + 1] << 16; @@ -59,8 +59,8 @@ static void check_drive(uint16_t base, uint8_t master_or_slave) void ata_init() { - uint8_t pri_status = inb(PRIMARY_BASE + COM_STAT); - uint8_t sec_status = inb(SECONDARY_BASE + COM_STAT); + u8 pri_status = inb(PRIMARY_BASE + COM_STAT); + u8 sec_status = inb(SECONDARY_BASE + COM_STAT); bool primary_floating = false; bool secondary_floating = false; if (pri_status == 0xFF) @@ -90,14 +90,14 @@ void ata_init() static void poll() { - uint8_t stat; + u8 stat; do stat = read_stat(sel_base_port); while ((stat & BSY) != 0); } -void read_abs_sectors(uint32_t lba, uint8_t sector_count, uint16_t buf[]) +void read_abs_sectors(u32 lba, u8 sector_count, u16 buf[]) { assert(lba >> LBA_BITS == 0); @@ -110,7 +110,7 @@ void read_abs_sectors(uint32_t lba, uint8_t sector_count, uint16_t buf[]) outb(sel_base_port + COM_STAT, READ_SECTORS); - size_t i = 0; + u32 i = 0; for (; sector_count > 0; sector_count--) { poll(); diff --git a/src/kernel/fs/ata.h b/src/kernel/fs/ata.h index b3774e1..0422fe3 100644 --- a/src/kernel/fs/ata.h +++ b/src/kernel/fs/ata.h @@ -40,6 +40,6 @@ void ata_init(); -void read_abs_sectors(uint32_t lba, uint8_t sector_count, uint16_t buf[]); +void read_abs_sectors(u32 lba, u8 sector_count, u16 buf[]); #endif
\ No newline at end of file diff --git a/src/kernel/fs/elf.c b/src/kernel/fs/elf.c index 37cc606..bee53c9 100644 --- a/src/kernel/fs/elf.c +++ b/src/kernel/fs/elf.c @@ -1,14 +1,14 @@ #include <stdint.h> #include <stddef.h> -#include <kernel/system.h> -#include <kernel/fs/elf.h> -#include <kernel/lib/stdio.h> -#include <kernel/memory/alloc.h> -#include <kernel/lib/lib.h> -#include <kernel/memory/paging.h> -#include <kernel/fs/ext2.h> -#include <kernel/gdt/gdt.h> -#include <kernel/tasks/process.h> +#include <system.h> +#include <fs/elf.h> +#include <lib/stdio.h> +#include <memory/alloc.h> +#include <lib/lib.h> +#include <memory/paging.h> +#include <fs/ext2.h> +#include <gdt/gdt.h> +#include <tasks/process.h> int is_elf(struct elf_header *header) { @@ -23,7 +23,7 @@ int is_elf(struct elf_header *header) struct process *elf_load(char *path) { - uint8_t *file = read_file(path); + u8 *file = read_file(path); if (!file) { warn("File or directory not found: %s", path); return NULL; @@ -44,7 +44,7 @@ struct process *elf_load(char *path) proc->registers.eip = header->entry; paging_switch_directory(proc->cr3); - uint32_t stk = (uint32_t)kmalloc_a(PAGE_S); + u32 stk = (u32)kmalloc_a(PAGE_S); proc->registers.useresp = 0x40000000 - (PAGE_S / 2); proc->registers.ebp = proc->registers.useresp; proc->registers.esp = proc->registers.useresp; @@ -56,10 +56,10 @@ struct process *elf_load(char *path) break; case 1: debug("Allocating space for ELF binary section..."); - uint32_t loc = (uint32_t)kmalloc_a(PAGE_S); + u32 loc = (u32)kmalloc_a(PAGE_S); paging_map_user(proc->cr3, loc, program_header->vaddr); memcpy((void *)program_header->vaddr, - ((void *)((uint32_t)file) + program_header->offset), + ((void *)((u32)file) + program_header->offset), program_header->filesz); if (program_header->filesz > PAGE_S) panic("ELF binary section too large"); diff --git a/src/kernel/fs/elf.h b/src/kernel/fs/elf.h index 8c7d38a..f9a3562 100644 --- a/src/kernel/fs/elf.h +++ b/src/kernel/fs/elf.h @@ -2,7 +2,7 @@ #define MELVIX_ELF_H #include <stdint.h> -#include <kernel/tasks/process.h> +#include <tasks/process.h> #define ELF_MAG 0x7F // 0 #define ELF_32 (1) // 4: 32-bit Architecture @@ -29,48 +29,48 @@ #define PF_R 0x4 struct elf_priv_data { - uint32_t sig; + u32 sig; }; struct elf_header { - uint8_t ident[16]; - uint16_t type; - uint16_t machine; - uint32_t version; - uint32_t entry; - uint32_t phoff; - uint32_t shoff; - uint32_t flags; - uint16_t ehsize; - uint16_t phentsize; - uint16_t phnum; - uint16_t shentsize; - uint16_t shnum; - uint16_t shstrndx; + u8 ident[16]; + u16 type; + u16 machine; + u32 version; + u32 entry; + u32 phoff; + u32 shoff; + u32 flags; + u16 ehsize; + u16 phentsize; + u16 phnum; + u16 shentsize; + u16 shnum; + u16 shstrndx; }; struct elf_section_header { - uint32_t name; - uint32_t type; - uint32_t flags; - uint32_t addr; - uint32_t offset; - uint32_t size; - uint32_t link; - uint32_t info; - uint32_t addralign; - uint32_t entsize; + u32 name; + u32 type; + u32 flags; + u32 addr; + u32 offset; + u32 size; + u32 link; + u32 info; + u32 addralign; + u32 entsize; }; struct elf_program_header { - uint32_t type; - uint32_t offset; - uint32_t vaddr; - uint32_t paddr; - uint32_t filesz; - uint32_t memsz; - uint32_t flags; - uint32_t align; + u32 type; + u32 offset; + u32 vaddr; + u32 paddr; + u32 filesz; + u32 memsz; + u32 flags; + u32 align; }; int is_elf(struct elf_header *header); diff --git a/src/kernel/fs/ext2.c b/src/kernel/fs/ext2.c index b4f81a8..78d1dc4 100644 --- a/src/kernel/fs/ext2.c +++ b/src/kernel/fs/ext2.c @@ -1,21 +1,21 @@ #include <stddef.h> #include <stdint.h> #include <stdbool.h> -#include <kernel/fs/ata.h> -#include <kernel/fs/ext2.h> -#include <kernel/system.h> -#include <kernel/memory/alloc.h> -#include <kernel/lib/lib.h> -#include <kernel/lib/stdlib.h> +#include <fs/ata.h> +#include <fs/ext2.h> +#include <system.h> +#include <memory/alloc.h> +#include <lib/lib.h> +#include <lib/stdlib.h> static struct ext2_superblock superblock; static struct bgd *bgdt; -static size_t block_size; -static size_t num_groups; -static void read_block(uint32_t block_num, void *buf); +static u32 block_size; +static u32 num_groups; +static void read_block(u32 block_num, void *buf); static void load_superblock(); static void load_bgdt(); -static void read_inode(struct ext2_inode *inode, uint32_t inode_num); +static void read_inode(struct ext2_inode *inode, u32 inode_num); void ext2_init_fs() { @@ -38,17 +38,17 @@ void ext2_init_fs() debug("Inode %d, name '%s'", dirent.inode_num, dirent.name); } -static void read_block(uint32_t block_num, void *buf) +static void read_block(u32 block_num, void *buf) { - uint32_t lba = block_num * block_size / SECTOR_SIZE; - size_t sectors = block_size / SECTOR_SIZE; + u32 lba = block_num * block_size / SECTOR_SIZE; + u32 sectors = block_size / SECTOR_SIZE; read_abs_sectors(lba, sectors, buf); } static void load_superblock() { - uint16_t buf[SUPERBLOCK_LENGTH / 2]; + u16 buf[SUPERBLOCK_LENGTH / 2]; read_abs_sectors(SUPERBLOCK_LBA, SUPERBLOCK_SECTORS, buf); memcpy(&superblock, buf, sizeof(struct ext2_superblock)); @@ -70,38 +70,38 @@ static void load_superblock() static void load_bgdt() { - size_t bgdt_sectors = (sizeof(struct bgd) * num_groups) / SECTOR_SIZE + 1; - size_t bgdt_block = (SUPERBLOCK_OFFSET + SUPERBLOCK_LENGTH) / block_size + 1; - uint32_t bgdt_lba = bgdt_block * block_size / SECTOR_SIZE; + u32 bgdt_sectors = (sizeof(struct bgd) * num_groups) / SECTOR_SIZE + 1; + u32 bgdt_block = (SUPERBLOCK_OFFSET + SUPERBLOCK_LENGTH) / block_size + 1; + u32 bgdt_lba = bgdt_block * block_size / SECTOR_SIZE; - uint16_t buf[bgdt_sectors * SECTOR_SIZE / 2]; + u16 buf[bgdt_sectors * SECTOR_SIZE / 2]; read_abs_sectors(bgdt_lba, bgdt_sectors, buf); - size_t bgdt_size = sizeof(struct bgd) * num_groups; + u32 bgdt_size = sizeof(struct bgd) * num_groups; bgdt = kmalloc(bgdt_size); memcpy(bgdt, buf, bgdt_size); } -static void read_inode(struct ext2_inode *inode, uint32_t inode_num) +static void read_inode(struct ext2_inode *inode, u32 inode_num) { inode_num--; - size_t block_group = inode_num / superblock.inodes_per_group; + u32 block_group = inode_num / superblock.inodes_per_group; struct bgd *bgd = &bgdt[block_group]; - uint32_t i_table_block = bgd->inode_table_addr; + u32 i_table_block = bgd->inode_table_addr; - size_t index = inode_num % superblock.inodes_per_group; - size_t block_offset = (index * INODE_SIZE) / block_size; - size_t offset_in_block = (index * INODE_SIZE) % block_size; - size_t block = i_table_block + block_offset; + u32 index = inode_num % superblock.inodes_per_group; + u32 block_offset = (index * INODE_SIZE) / block_size; + u32 offset_in_block = (index * INODE_SIZE) % block_size; + u32 block = i_table_block + block_offset; - size_t num_sectors = sizeof(struct ext2_inode) / SECTOR_SIZE + 1; - uint16_t buf[num_sectors * SECTOR_SIZE / 2]; + u32 num_sectors = sizeof(struct ext2_inode) / SECTOR_SIZE + 1; + u16 buf[num_sectors * SECTOR_SIZE / 2]; read_abs_sectors(block * block_size / SECTOR_SIZE, num_sectors, buf); memcpy(inode, &buf[offset_in_block / 2], sizeof(struct ext2_inode)); } -void ext2_open_inode(uint32_t inode_num, struct ext2_file *file) +void ext2_open_inode(u32 inode_num, struct ext2_file *file) { read_inode(&file->inode, inode_num); file->pos = 0; @@ -112,15 +112,15 @@ void ext2_open_inode(uint32_t inode_num, struct ext2_file *file) read_block(file->inode.dbp[0], file->buf); } -size_t ext2_read(struct ext2_file *file, uint8_t *buf, size_t count) +u32 ext2_read(struct ext2_file *file, u8 *buf, u32 count) { if (file->pos + count > file->inode.size) count = file->inode.size - file->pos; - size_t bytes_left = count; + u32 bytes_left = count; while (bytes_left > 0) { - size_t to_copy = bytes_left; + u32 to_copy = bytes_left; bool new_block = file->curr_block_pos + to_copy >= block_size; if (new_block) @@ -136,7 +136,7 @@ size_t ext2_read(struct ext2_file *file, uint8_t *buf, size_t count) file->block_index++; if (file->block_index >= 12) { // TODO: Add triple block pointer support - uint32_t *tmp = kmalloc(block_size); + u32 *tmp = kmalloc(block_size); read_block(file->inode.ibp, tmp); read_block(tmp[file->block_index - 12], file->buf); } else { @@ -148,36 +148,36 @@ size_t ext2_read(struct ext2_file *file, uint8_t *buf, size_t count) return count; } -#define READ_SIZE (sizeof(struct ext2_dirent) - sizeof(uint8_t *)) +#define READ_SIZE (sizeof(struct ext2_dirent) - sizeof(u8 *)) bool ext2_next_dirent(struct ext2_file *file, struct ext2_dirent *dir) { - uint8_t buf[READ_SIZE]; + u8 buf[READ_SIZE]; if (ext2_read(file, buf, READ_SIZE) != READ_SIZE) return false; memcpy(dir, buf, READ_SIZE); - size_t size = dir->name_len + 1; - uint8_t *name = kmalloc(size); + u32 size = dir->name_len + 1; + u8 *name = kmalloc(size); if (ext2_read(file, name, size - 1) != size - 1) return false; dir->name = name; dir->name[size - 1] = '\0'; - size_t bytes_left = dir->total_len - (READ_SIZE + size - 1); + u32 bytes_left = dir->total_len - (READ_SIZE + size - 1); if (bytes_left > 0) { - uint8_t dummy[bytes_left]; + u8 dummy[bytes_left]; ext2_read(file, dummy, bytes_left); } return true; } -uint32_t ext2_find_in_dir(uint32_t dir_inode, const char *name) +u32 ext2_find_in_dir(u32 dir_inode, const char *name) { - uint32_t inode; + u32 inode; struct ext2_file dir; struct ext2_dirent dirent; @@ -196,16 +196,16 @@ cleanup: return inode; } -uint32_t ext2_look_up_path(char *path) +u32 ext2_look_up_path(char *path) { if (path[0] != '/') return 0; path++; - uint32_t curr_dir_inode = ROOT_INODE; + u32 curr_dir_inode = ROOT_INODE; while (1) { - size_t j; + u32 j; for (j = 0; path[j] != '/' && path[j] != '\0'; j++) ; @@ -222,7 +222,7 @@ uint32_t ext2_look_up_path(char *path) path += j + 1; } - uint32_t inode = ext2_find_in_dir(curr_dir_inode, path); + u32 inode = ext2_find_in_dir(curr_dir_inode, path); if (inode == 0) return 0; diff --git a/src/kernel/fs/ext2.h b/src/kernel/fs/ext2.h index f63b8b6..e5c26fe 100644 --- a/src/kernel/fs/ext2.h +++ b/src/kernel/fs/ext2.h @@ -17,71 +17,71 @@ #define SUPERBLOCK_SECTORS (SUPERBLOCK_LENGTH / SECTOR_SIZE) struct ext2_superblock { - uint32_t total_inodes; - uint32_t total_blocks; - uint32_t su_res_blocks; // Superuser reserved - uint32_t free_blocks; - uint32_t free_inodes; - uint32_t superblock_block_num; - uint32_t log2_block_size; - uint32_t log2_frag_size; - uint32_t blocks_per_group; - uint32_t frags_per_group; - uint32_t inodes_per_group; - uint32_t last_mount_time; - uint32_t last_write_time; - uint16_t mounts_since_fsck; - uint16_t max_mounts_since_fsck; - uint16_t signature; - uint16_t state; // 1 clean; 2 errors - uint16_t error_action; - uint16_t minor_version; - uint32_t last_fsck_time; - uint32_t max_time_since_fsck; - uint32_t creator_os_id; - uint32_t major_version; - uint16_t res_block_uid; - uint16_t res_block_gid; + u32 total_inodes; + u32 total_blocks; + u32 su_res_blocks; // Superuser reserved + u32 free_blocks; + u32 free_inodes; + u32 superblock_block_num; + u32 log2_block_size; + u32 log2_frag_size; + u32 blocks_per_group; + u32 frags_per_group; + u32 inodes_per_group; + u32 last_mount_time; + u32 last_write_time; + u16 mounts_since_fsck; + u16 max_mounts_since_fsck; + u16 signature; + u16 state; // 1 clean; 2 errors + u16 error_action; + u16 minor_version; + u32 last_fsck_time; + u32 max_time_since_fsck; + u32 creator_os_id; + u32 major_version; + u16 res_block_uid; + u16 res_block_gid; } __attribute__((packed)); // Block group descriptor struct bgd { - uint32_t block_bitmap_addr; - uint32_t inode_bitmap_addr; - uint32_t inode_table_addr; - uint16_t free_blocks; - uint16_t free_inodes; - uint16_t used_dirs; - uint16_t pad; - uint8_t bg_reserved[12]; + u32 block_bitmap_addr; + u32 inode_bitmap_addr; + u32 inode_table_addr; + u16 free_blocks; + u16 free_inodes; + u16 used_dirs; + u16 pad; + u8 bg_reserved[12]; } __attribute__((packed)); struct ext2_inode { - uint16_t mode; - uint16_t uid; - uint32_t size; - - uint32_t last_access_time; - uint32_t creation_time; - uint32_t last_modification_time; - uint32_t deletion_time; - - uint16_t gid; - uint16_t link_count; - uint32_t sectors_used; - uint32_t flags; - uint32_t os_specific_val1; - uint32_t dbp[12]; - uint32_t ibp; - uint32_t dibp; - uint32_t tibp; - uint32_t gen_number; - - uint32_t reserved1; - uint32_t reserved2; - - uint32_t fragment_addr; - uint8_t os_specific_val2[12]; + u16 mode; + u16 uid; + u32 size; + + u32 last_access_time; + u32 creation_time; + u32 last_modification_time; + u32 deletion_time; + + u16 gid; + u16 link_count; + u32 sectors_used; + u32 flags; + u32 os_specific_val1; + u32 dbp[12]; + u32 ibp; + u32 dibp; + u32 tibp; + u32 gen_number; + + u32 reserved1; + u32 reserved2; + + u32 fragment_addr; + u8 os_specific_val2[12]; } __attribute__((packed)); #define S_IFIFO 0x1000 @@ -125,29 +125,29 @@ struct ext2_inode { struct fs_node *ext2_root; struct ext2_dirent { - uint32_t inode_num; - uint16_t total_len; - uint8_t name_len; - uint8_t type_indicator; - uint8_t *name; + u32 inode_num; + u16 total_len; + u8 name_len; + u8 type_indicator; + u8 *name; } __attribute__((packed)); struct ext2_file { struct ext2_inode inode; - size_t pos; - uint8_t block_index; - uint8_t *buf; - size_t curr_block_pos; + u32 pos; + u8 block_index; + u8 *buf; + u32 curr_block_pos; }; void ext2_init_fs(); -void ext2_open_inode(uint32_t inode_num, struct ext2_file *file); -size_t ext2_read(struct ext2_file *file, uint8_t *buf, size_t count); +void ext2_open_inode(u32 inode_num, struct ext2_file *file); +u32 ext2_read(struct ext2_file *file, u8 *buf, u32 count); bool ext2_next_dirent(struct ext2_file *file, struct ext2_dirent *dir); -uint32_t ext2_find_in_dir(uint32_t dir_inode, const char *name); -uint32_t ext2_look_up_path(char *path); +u32 ext2_find_in_dir(u32 dir_inode, const char *name); +u32 ext2_look_up_path(char *path); -uint8_t *read_file(char *path); +u8 *read_file(char *path); void ext2_node_init(struct fs_node *node); void ext2_mount(struct fs_node *mountpoint); diff --git a/src/kernel/fs/fs.c b/src/kernel/fs/fs.c index 1553113..a57a83e 100644 --- a/src/kernel/fs/fs.c +++ b/src/kernel/fs/fs.c @@ -1,11 +1,11 @@ #include <stdint.h> -#include <kernel/fs/ext2.h> -#include <kernel/system.h> -#include <kernel/memory/alloc.h> +#include <fs/ext2.h> +#include <system.h> +#include <memory/alloc.h> -uint32_t get_file_size(char *path) +u32 get_file_size(char *path) { - uint32_t inode = ext2_look_up_path(path); + u32 inode = ext2_look_up_path(path); struct ext2_file file; ext2_open_inode(inode, &file); if (inode != 0) { @@ -17,9 +17,9 @@ uint32_t get_file_size(char *path) } // TODO: Implement offset -uint32_t read(char *path, uint32_t offset, uint32_t count, uint8_t *buf) +u32 read(char *path, u32 offset, u32 count, u8 *buf) { - uint32_t inode = ext2_look_up_path(path); + u32 inode = ext2_look_up_path(path); struct ext2_file file; ext2_open_inode(inode, &file); if (inode != 0) { @@ -35,21 +35,21 @@ uint32_t read(char *path, uint32_t offset, uint32_t count, uint8_t *buf) } // TODO: Implement writing -uint32_t write(char *path, uint32_t offset, uint32_t count, uint8_t *buf) +u32 write(char *path, u32 offset, u32 count, u8 *buf) { warn("Writing is not supported!"); return -1; } -uint8_t *read_file(char *path) +u8 *read_file(char *path) { - uint32_t inode = ext2_look_up_path(path); + u32 inode = ext2_look_up_path(path); struct ext2_file file; ext2_open_inode(inode, &file); if (inode != 0) { - size_t size = file.inode.size; + u32 size = file.inode.size; debug("Reading %s: %dKiB", path, size >> 10); - uint8_t *buf = kmalloc(size); + u8 *buf = kmalloc(size); ext2_read(&file, buf, size); kfree(file.buf); buf[size - 1] = '\0'; diff --git a/src/kernel/fs/fs.h b/src/kernel/fs/fs.h index 88dcd95..58b23db 100644 --- a/src/kernel/fs/fs.h +++ b/src/kernel/fs/fs.h @@ -3,9 +3,9 @@ #include <stdint.h> -uint32_t get_file_size(char *path); -uint32_t read(char *path, uint32_t offset, uint32_t count, uint8_t *buf); -uint32_t write(char *path, uint32_t offset, uint32_t count, uint8_t *buf); -uint8_t *read_file(char *path); // Only for temp kernel reads +u32 get_file_size(char *path); +u32 read(char *path, u32 offset, u32 count, u8 *buf); +u32 write(char *path, u32 offset, u32 count, u8 *buf); +u8 *read_file(char *path); // Only for temp kernel reads #endif
\ No newline at end of file diff --git a/src/kernel/fs/load.c b/src/kernel/fs/load.c index f3e46ed..0170f26 100644 --- a/src/kernel/fs/load.c +++ b/src/kernel/fs/load.c @@ -1,8 +1,8 @@ -#include <kernel/fs/load.h> -#include <kernel/system.h> -#include <kernel/lib/stdio.h> -#include <kernel/lib/lib.h> -#include <kernel/fs/ext2.h> +#include <fs/load.h> +#include <system.h> +#include <lib/stdio.h> +#include <lib/lib.h> +#include <fs/ext2.h> void load_binaries() { diff --git a/src/kernel/fs/load.h b/src/kernel/fs/load.h index d03b0ec..b2376be 100644 --- a/src/kernel/fs/load.h +++ b/src/kernel/fs/load.h @@ -6,10 +6,10 @@ struct font *font; struct font { - uint16_t font_32[758][32]; - uint16_t font_24[758][24]; - uint8_t font_16[758][16]; - uint16_t cursor[19]; + u16 font_32[758][32]; + u16 font_24[758][24]; + u8 font_16[758][16]; + u16 cursor[19]; }; void load_binaries(); |