summaryrefslogtreecommitdiff
path: root/include/unistd.h
diff options
context:
space:
mode:
authorJake Mannens <jake72360@gmail.com>2018-09-09 00:19:12 +1000
committerJake Mannens <jake72360@gmail.com>2018-09-09 00:19:12 +1000
commit02107df3f476c19bb7eaa3c49a368d703898615b (patch)
tree7cbace89d150f2f6c39f3ec5766f7263441fea22 /include/unistd.h
parent6d87016287ea76afbdf7e16fb2cf9e4fa20cc0de (diff)
Re-ordered system call numbers and definitions into alphabetical order
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.
Diffstat (limited to 'include/unistd.h')
-rw-r--r--include/unistd.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/unistd.h b/include/unistd.h
index cc0f766..47e1621 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -10,17 +10,17 @@ typedef int32_t ssize_t;
typedef int16_t pid_t;
-#define __SYS_time 0
-#define __SYS_getpid 1
+#define __SYS_alarm 0
+#define __SYS_ctty 1
#define __SYS_getpdir 2
-#define __SYS_signal 3
-#define __SYS_alarm 4
-#define __SYS_pause 5
-#define __SYS_ctty 6
+#define __SYS_getpid 3
+#define __SYS_kill 4
+#define __SYS_panic 5
+#define __SYS_pause 6
#define __SYS_read 7
-#define __SYS_write 8
-#define __SYS_kill 9
-#define __SYS_panic 10
+#define __SYS_signal 8
+#define __SYS_time 9
+#define __SYS_write 10
#define _syscall0(type, name) \
type name(void) { \