summaryrefslogtreecommitdiff
path: root/userspace/sys
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/sys')
-rw-r--r--userspace/sys/Makefile22
-rw-r--r--userspace/sys/crt.S (renamed from userspace/sys/crt0.S)0
-rw-r--r--userspace/sys/crt0.obin660 -> 0 bytes
-rw-r--r--userspace/sys/libfool.abin37550 -> 0 bytes
-rw-r--r--userspace/sys/linker.ld37
-rw-r--r--userspace/sys/sgtty.h15
-rw-r--r--userspace/sys/sys.obin18236 -> 0 bytes
-rw-r--r--userspace/sys/sys/ioctl.h0
-rw-r--r--userspace/sys/sys/termios.h (renamed from userspace/sys/termios.h)0
-rw-r--r--userspace/sys/syscalls.obin18544 -> 0 bytes
10 files changed, 59 insertions, 15 deletions
diff --git a/userspace/sys/Makefile b/userspace/sys/Makefile
index 2e71714..05177a6 100644
--- a/userspace/sys/Makefile
+++ b/userspace/sys/Makefile
@@ -1,31 +1,23 @@
SYSROOT=/home/miguel/opt/foolos
CC=i686-foolos-gcc
+LD=i686-foolos-ld
CFLAGS=
CFLAGS+=-w
CFLAGS+=-I../..
CFLAGS+=-gstabs
-OBJECTS=sys.o syscalls.o crt0.o
-
-full: clean library_install crt_install header_install
-
-all: $(OBJECTS)
-
-crt0.o: crt0.S
+install: crt_install header_install
crt_install: crt0.o
cp crt0.o $(SYSROOT)/usr/lib/
-header_install:
- cp termios.h $(SYSROOT)/usr/include/sys/
-
-libfool.a: sys.o syscalls.o
- ar rcs libfool.a sys.o syscalls.o
-
-library_install: libfool.a
- cp libfool.a $(SYSROOT)/usr/lib/
+crt0.o: crt.o sys.o syscalls.o
+ $(LD) -r $^ -o $@
+header_install:
+ cp *.h $(SYSROOT)/usr/include/
+ cp sys/*.h $(SYSROOT)/usr/include/sys/
clean:
-rm *.o *.a
diff --git a/userspace/sys/crt0.S b/userspace/sys/crt.S
index d09f8ca..d09f8ca 100644
--- a/userspace/sys/crt0.S
+++ b/userspace/sys/crt.S
diff --git a/userspace/sys/crt0.o b/userspace/sys/crt0.o
deleted file mode 100644
index 1b71404..0000000
--- a/userspace/sys/crt0.o
+++ /dev/null
Binary files differ
diff --git a/userspace/sys/libfool.a b/userspace/sys/libfool.a
deleted file mode 100644
index 0823595..0000000
--- a/userspace/sys/libfool.a
+++ /dev/null
Binary files differ
diff --git a/userspace/sys/linker.ld b/userspace/sys/linker.ld
new file mode 100644
index 0000000..7c1c4bf
--- /dev/null
+++ b/userspace/sys/linker.ld
@@ -0,0 +1,37 @@
+ENTRY(_start)
+
+SECTIONS
+{
+ . = 1M;
+
+ kernel_start = .;
+
+ .text BLOCK(4K) : ALIGN(4K)
+ {
+ *(.multiboot)
+ *(.text)
+ }
+
+ /* Read-only data. */
+ .rodata BLOCK(4K) : ALIGN(4K)
+ {
+ *(.rodata)
+ }
+
+ /* Read-write data (initialized) */
+ .data BLOCK(4K) : ALIGN(4K)
+ {
+ *(.data)
+ }
+
+ /* Read-write data (uninitialized) and stack */
+ .bss BLOCK(4K) : ALIGN(4K)
+ {
+ *(COMMON)
+ *(.bss)
+ *(.bootstrap_stack)
+ }
+
+ kernel_end = .;
+
+}
diff --git a/userspace/sys/sgtty.h b/userspace/sys/sgtty.h
new file mode 100644
index 0000000..9e91b44
--- /dev/null
+++ b/userspace/sys/sgtty.h
@@ -0,0 +1,15 @@
+#define TIOCFLUSH 0x01
+#define RAW 0x02
+#define CBREAK 0x04
+#define XTABS 0x08
+#define CRMOD 0x10
+#define ECHO 0x20
+
+struct sgttyb{
+ int sg_ospeed;
+ int sg_erase;
+ int sg_kill;
+ int sg_flags;
+
+ // TODO: same struct should be used for /terminal/terminal.h ?
+};
diff --git a/userspace/sys/sys.o b/userspace/sys/sys.o
deleted file mode 100644
index dc5a2e3..0000000
--- a/userspace/sys/sys.o
+++ /dev/null
Binary files differ
diff --git a/userspace/sys/sys/ioctl.h b/userspace/sys/sys/ioctl.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/userspace/sys/sys/ioctl.h
diff --git a/userspace/sys/termios.h b/userspace/sys/sys/termios.h
index b6625be..b6625be 100644
--- a/userspace/sys/termios.h
+++ b/userspace/sys/sys/termios.h
diff --git a/userspace/sys/syscalls.o b/userspace/sys/syscalls.o
deleted file mode 100644
index a0a4265..0000000
--- a/userspace/sys/syscalls.o
+++ /dev/null
Binary files differ