summaryrefslogtreecommitdiff
path: root/include/kernel/hd.h
AgeCommit message (Collapse)Author
2018-09-09Re-ordered system call numbers and definitions into alphabetical orderJake Mannens
to make management/maintenance easier. Defined the structures super_block and m_inode in kernel/fs.h for super blocks and inodes respectively. Added the new header file sys/stat.h which contains basic definitions for inode types and permissions. These definitions will be required by any functions handling m_inode structures. Moved the sys_read and sys_write system calls to the filesystem's main source file at kernel/fs/fs.c. Added the file kernel/fs/mount.c which will contain the super-blocks table as well as the function mount_root() which will attempt to mount the root filesystem during boot. Eventually, this file will be expanded to include a general-purpose mount function to mount any filesystem as well as the system call handler for sys_mount. Seperated block I/O functions into their own subsystem under kernel/fs/block.c which currently supports two functions; block_read() and block_write() to read and write blocks from block devices. Currently, no device can be specified since the primary ATA master drive is the only possible target. This will change in the future however. Modified the hard disk driver's read and write functions to use filesystem blocks rather than sectors as the units of transfer. This is intended to keep the block I/O subsystem simple by ensuring a uniform transfer unit is used across all block devices and drivers. The hard disk driver is no longer initialized during the main boot procedure. Instead, a call is made to the new function fs_init() which will setup filesystem tables and structures, call hd_init() to initialize the disk and finally, attempt to load the super-block for the root filesystem. The hard disk driver now stores the disk's size and sanity checks addresses and sizes in read and write calls against this value.
2018-07-16Included the necessary stdint.h in kernel/hd.h. That header file may nowJake Mannens
be used freely throughout the kernel.
2018-07-14con_init() is now called during the kernel's boot sequence in kboot()Jake Mannens
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.