From b48a2f6d291a4161ba50b97fce655070a575065b Mon Sep 17 00:00:00 2001 From: Yeongjin Jang Date: Mon, 1 Apr 2019 00:22:30 -0700 Subject: [PATCH 1/5] exit --- CODING | 2 -- README.info | 4 ++++ student.info | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 README.info create mode 100644 student.info diff --git a/CODING b/CODING index 898097e..f1d0795 100644 --- a/CODING +++ b/CODING @@ -15,8 +15,6 @@ We have the following conventions in our code: * Function names are all lower-case separated by underscores. -* Beginning-of-line indentation via tabs, not spaces. - * Preprocessor macros are always UPPERCASE. There are a few grandfathered exceptions: assert, panic, static_assert, offsetof. diff --git a/README.info b/README.info new file mode 100644 index 0000000..eaf6de5 --- /dev/null +++ b/README.info @@ -0,0 +1,4 @@ +Lab 1 : Tue 10:00 ~ 11:20 +Lab 2 : Tue 12:00 ~ 13:20 +Lab 3 : Wed 15:00 ~ 16:20 +Lab 4 : Fri 14:00 ~ 15:20 diff --git a/student.info b/student.info new file mode 100644 index 0000000..f3ede52 --- /dev/null +++ b/student.info @@ -0,0 +1,5 @@ +OSU ID (xxx-yyy-zzz) : 933456789 +FLIP ID (e.g., jangye) : jangye +Name : Yeongjin Jang +CS 444/544 ? : 444 +Lab Class # : Lab 1 From ae442212be02b16b7e8b2d4e7d1e683040a28532 Mon Sep 17 00:00:00 2001 From: Yeongjin Jang Date: Mon, 1 Apr 2019 01:22:52 -0700 Subject: [PATCH 2/5] hint --- kern/monitor.c | 5 ++++- lib/printfmt.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kern/monitor.c b/kern/monitor.c index e137e92..ee25809 100644 --- a/kern/monitor.c +++ b/kern/monitor.c @@ -21,6 +21,7 @@ struct Command { int (*func)(int argc, char** argv, struct Trapframe* tf); }; +// LAB 1: add your command to here... static struct Command commands[] = { { "help", "Display this list of commands", mon_help }, { "kerninfo", "Display information about the kernel", mon_kerninfo }, @@ -57,7 +58,9 @@ mon_kerninfo(int argc, char **argv, struct Trapframe *tf) int mon_backtrace(int argc, char **argv, struct Trapframe *tf) { - // Your code here. + // LAB 1: Your code here. + // HINT 1: use read_ebp(). + // HINT 2: print the current ebp on the first line (not current_ebp[0]) return 0; } diff --git a/lib/printfmt.c b/lib/printfmt.c index 28e01c9..802adcd 100644 --- a/lib/printfmt.c +++ b/lib/printfmt.c @@ -205,7 +205,7 @@ vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) // (unsigned) octal case 'o': - // Replace this with your code. + // LAB 1: Replace this with your code. putch('X', putdat); putch('X', putdat); putch('X', putdat); From f1840b8b11fd0fdc90091cb8dffaa8721fcede40 Mon Sep 17 00:00:00 2001 From: Yeongjin Jang Date: Mon, 1 Apr 2019 21:22:40 -0700 Subject: [PATCH 3/5] add some hints --- kern/trap.c | 14 +++++++++++++- kern/trapentry.S | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/kern/trap.c b/kern/trap.c index e27b556..7f6075f 100644 --- a/kern/trap.c +++ b/kern/trap.c @@ -59,14 +59,26 @@ static const char *trapname(int trapno) } +// XYZ: write a function declaration here... +// e.g., void t_divide(); + void trap_init(void) { extern struct Segdesc gdt[]; + /* + * + * HINT + * Do something like this: SETGATE(idt[T_DIVIDE], 0, GD_KT, t_divide, 0); + * if your trap handler's name for divide by zero is t_device. + * Additionally, you should declare trap handler as a function + * to refer that in C code... (see the comment XYZ above) + * + */ // LAB 3: Your code here. - // Per-CPU setup + // Per-CPU setup trap_init_percpu(); } diff --git a/kern/trapentry.S b/kern/trapentry.S index 22fc640..80dfe58 100644 --- a/kern/trapentry.S +++ b/kern/trapentry.S @@ -47,9 +47,15 @@ * Lab 3: Your code here for generating entry points for the different traps. */ - +// HINT 1 : TRAPHANDLER_NOEC(t_divide, T_DIVIDE); +// Do something like this if there is no error code for the trap +// HINT 2 : TRAPHANDLER(t_dblflt, T_DBLFLT); +// Do something like this if the trap includes an error code.. +// HINT 3 : READ Intel's manual to check if the trap includes an error code +// or not... /* * Lab 3: Your code here for _alltraps */ + From 467f147d83f0631f42109deb4f3405154a61320e Mon Sep 17 00:00:00 2001 From: Yeongjin Jang Date: Mon, 1 Apr 2019 21:31:33 -0700 Subject: [PATCH 4/5] gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 301b097..21f2c54 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ /myapi.key /.suf tags +.gdb_history +peda*.txt +.*.swp From 7d3fde5f77eb0b2437f6558e4b6df512fc0a4ad1 Mon Sep 17 00:00:00 2001 From: Yeongjin Jang Date: Mon, 1 Apr 2019 21:36:31 -0700 Subject: [PATCH 5/5] add hint --- kern/sched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kern/sched.c b/kern/sched.c index f595bb1..9b3939f 100644 --- a/kern/sched.c +++ b/kern/sched.c @@ -74,6 +74,7 @@ sched_halt(void) "movl %0, %%esp\n" "pushl $0\n" "pushl $0\n" + // LAB 4: // Uncomment the following line after completing exercise 13 //"sti\n" "1:\n"