aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-11-24 01:33:01 +0100
committerGustav Sörnäs <gustav@sornas.net>2020-11-24 01:33:01 +0100
commit431c40e275a5055d9f144de03dbc8cfc90ed3f6e (patch)
treeb311bcda0d5d6b445a123f4be7a2d4f2d756addb /src
parent0f45ab11bd271535f178b58aab1ae9c36474d995 (diff)
downloadpintos-rs-431c40e275a5055d9f144de03dbc8cfc90ed3f6e.tar.gz
add kernel-rs
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.build13
-rw-r--r--src/userprog/syscall.c36
2 files changed, 29 insertions, 20 deletions
diff --git a/src/Makefile.build b/src/Makefile.build
index b5474f5..96757cb 100644
--- a/src/Makefile.build
+++ b/src/Makefile.build
@@ -78,8 +78,16 @@ DEPENDS = $(patsubst %.o,%.d,$(OBJECTS))
threads/kernel.lds.s: CPPFLAGS += -P
threads/kernel.lds.s: threads/kernel.lds.S threads/loader.h
-kernel.o: threads/kernel.lds.s $(OBJECTS)
- $(LD) -T $< -o $@ $(OBJECTS)
+LIBDIR_RUST = $(SRCDIR)/../kernel
+
+LIB_RUST = libkernel-rs.a
+
+$(LIB_RUST):
+ make -C $(LIBDIR_RUST) debug
+ cp $(LIBDIR_RUST)/target/debug/libkernel.a $@
+
+kernel.o: threads/kernel.lds.s $(OBJECTS) $(LIB_RUST)
+ $(LD) -T $< -o $@ $(OBJECTS) $(LIB_RUST)
kernel.bin: kernel.o
$(OBJCOPY) -O binary -R .note -R .comment -S $< $@.tmp
@@ -96,6 +104,7 @@ os.dsk: loader.bin kernel.bin
cat $^ > $@
clean::
+ make -C $(LIBDIR_RUST) clean
rm -f $(OBJECTS) $(DEPENDS)
rm -f threads/loader.o threads/kernel.lds.s threads/loader.d
rm -f kernel.o kernel.lds.s
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c
index 4d46978..ced27aa 100644
--- a/src/userprog/syscall.c
+++ b/src/userprog/syscall.c
@@ -41,21 +41,21 @@ const int argc[] = {
0
};
-static void
-syscall_handler (struct intr_frame *f)
-{
- int32_t* esp = (int32_t*)f->esp;
-
- switch ( 0 /* retrive syscall number */ )
- {
- default:
- {
- printf ("Executed an unknown system call!\n");
-
- printf ("Stack top + 0: %d\n", esp[0]);
- printf ("Stack top + 1: %d\n", esp[1]);
-
- thread_exit ();
- }
- }
-}
+//static void
+//syscall_handler (struct intr_frame *f)
+//{
+// int32_t* esp = (int32_t*)f->esp;
+//
+// switch ( 0 /* retrive syscall number */ )
+// {
+// default:
+// {
+// printf ("Executed an unknown system call!\n");
+//
+// printf ("Stack top + 0: %d\n", esp[0]);
+// printf ("Stack top + 1: %d\n", esp[1]);
+//
+// thread_exit ();
+// }
+// }
+//}