summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm/io.h19
-rw-r--r--include/kernel/fs.h18
-rw-r--r--include/kernel/hd.h7
-rw-r--r--include/sys/types.h2
4 files changed, 41 insertions, 5 deletions
diff --git a/include/asm/io.h b/include/asm/io.h
index 1c2e5bc..09294f4 100644
--- a/include/asm/io.h
+++ b/include/asm/io.h
@@ -5,10 +5,19 @@
*/
#define inb(port) ({ \
- unsigned char _val; \
- __asm__ volatile ("inb %%dx, %%al" : "=a" (_val) : "d" (port)); \
- _val; \
- })
+ unsigned char _val; \
+ __asm__ volatile ("inb %%dx, %%al" : "=a" (_val) : "d" (port)); \
+ _val; \
+ })
+
+#define inw(port) ({ \
+ unsigned short _val; \
+ __asm__ volatile ("inw %%dx, %%ax" : "=a" (_val) : "d" (port)); \
+ _val; \
+ })
#define outb(port, val) \
- __asm__ volatile ("outb %%al, %%dx" : : "d" (port), "a" (val));
+ __asm__ volatile ("outb %%al, %%dx" :: "d" (port), "a" (val));
+
+#define outw(port, val) \
+ __asm__ volatile ("outw %%ax, %%dx" :: "d" (port), "a" (val));
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
diff --git a/include/kernel/hd.h b/include/kernel/hd.h
new file mode 100644
index 0000000..26c705d
--- /dev/null
+++ b/include/kernel/hd.h
@@ -0,0 +1,7 @@
+#ifndef _HD_H
+#define _HD_H
+
+int hd_read(void*, uint32_t, uint8_t);
+int hd_write(void*, uint32_t, uint8_t);
+
+#endif
diff --git a/include/sys/types.h b/include/sys/types.h
index ace1a62..6c18e16 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -17,4 +17,6 @@ typedef uint32_t size_t;
typedef int32_t time_t;
#endif
+typedef long off_t;
+
#endif