diff options
| author | Jake Mannens <jake72360@gmail.com> | 2018-07-14 03:42:12 +1000 |
|---|---|---|
| committer | Jake Mannens <jake72360@gmail.com> | 2018-07-14 03:42:12 +1000 |
| commit | 35685c20a5dc299edf6f3b76ed898a2e71d0e457 (patch) | |
| tree | 0c4ef9eb71eedb2a3d414b6454f86529400a717e /include/kernel/fs.h | |
| parent | be74842e37ad54f4fd18ae647e2bdf3e435a0fb8 (diff) | |
con_init() is now called during the kernel's boot sequence in kboot()
rather than in kmain() as some subsystems may now require early console
I/O.
Added 16-bit read/write I/O functions to asm/io.h. These functions are
inw() and outw() respectively.
Added the file kernel/fs.h which will contain definitions relating to
filesystem functions.
Defined the type off_t as a signed 32-bit value in sys/types.h. This
type will be required for filesystem functionality.
Added the directory 'kernel/fs' to the project's source tree. The
kernel's makefile has been updated accordingly. This directory will
contain any source files relating to filesystem functionality (both
assembly and C files).
Added the file 'fs/hd.c' to the kernel's source tree. This file
currently contains three main functions (which are defined in
kernel/hd.h). These functions are as follows; hd_init() to enumerate and
initialize the hard disks, hd_read() to read sectors from the disk and
hd_write() to write sectors to the disk. Currently, all transfers are
done in ATA PIO mode using polling, however this will change in future.
The function hd_init() is called during the kernel's boot sequence in
kboot().
Added the file hd.img to the project's root directory. This is a 20MB
raw image file that will be used by Qemu as a 20MB hard disk. The main
makefile has been updated to tell Qemu to use this file on launch.
Diffstat (limited to 'include/kernel/fs.h')
| -rw-r--r-- | include/kernel/fs.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/kernel/fs.h b/include/kernel/fs.h new file mode 100644 index 0000000..8f21110 --- /dev/null +++ b/include/kernel/fs.h @@ -0,0 +1,18 @@ +#ifndef _FS_H +#define _FS_H + +#include <stdint.h> +#include <sys/types.h> + +#define BLOCK_SIZE 1024 +#define NRFILE 128 +#define NROPEN 32 + +struct file { + uint16_t f_mode; + uint16_t f_flags; + /* TODO: inode pointer here */ + off_t f_pos; +}; + +#endif |
