Skip to content

Commit 1a83673

Browse files
committed
Lab 1
0 parents  commit 1a83673

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5904
-0
lines changed

.dir-locals.el

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
((nil
2+
(indent-tabs-mode . t)
3+
(tab-width . 8))
4+
(c-mode
5+
(c-file-style . "bsd")
6+
(c-basic-offset . 8))
7+
(shell-mode
8+
(sh-basic-offset . 8)
9+
(sh-indentation . 8))
10+
(python-mode
11+
(indent-tabs-mode . nil))
12+
)

.gdbinit.tmpl

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
set $lastcs = -1
2+
3+
define hook-stop
4+
# There doesn't seem to be a good way to detect if we're in 16- or
5+
# 32-bit mode, but we always run with CS == 8 in 32-bit mode.
6+
if $cs == 8 || $cs == 27
7+
if $lastcs != 8 && $lastcs != 27
8+
set architecture i386
9+
end
10+
x/i $pc
11+
else
12+
if $lastcs == -1 || $lastcs == 8 || $lastcs == 27
13+
set architecture i8086
14+
end
15+
# Translate the segment:offset into a physical address
16+
printf "[%4x:%4x] ", $cs, $eip
17+
x/i $cs*16+$eip
18+
end
19+
set $lastcs = $cs
20+
end
21+
22+
echo + target remote localhost:1234\n
23+
target remote localhost:1234
24+
25+
# If this fails, it's probably because your GDB doesn't support ELF.
26+
# Look at the tools page at
27+
# http://pdos.csail.mit.edu/6.828/2009/tools.html
28+
# for instructions on building GDB with ELF support.
29+
echo + symbol-file obj/kern/kernel\n
30+
symbol-file obj/kern/kernel

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/obj
2+
/jos.in
3+
/jos.log
4+
/jos.out
5+
/jos.out.*
6+
/jos.cmd
7+
/.gdbinit
8+
/wget.log
9+
/qemu.pcap
10+
/qemu.pcap.*
11+
/qemu.out
12+
/qemu.log
13+
/gradelib.pyc
14+
/lab*-handin.tar.gz
15+
/lab?/
16+
/sol?/
17+
/myapi.key
18+
/.suf

CODING

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
JOS CODING STANDARDS
2+
3+
It's easier on everyone if all authors working on a shared
4+
code base are consistent in the way they write their programs.
5+
We have the following conventions in our code:
6+
7+
* No space after the name of a function in a call
8+
For example, printf("hello") not printf ("hello").
9+
10+
* One space after keywords "if", "for", "while", "switch".
11+
For example, if (x) not if(x).
12+
13+
* Space before braces.
14+
For example, if (x) { not if (x){.
15+
16+
* Function names are all lower-case separated by underscores.
17+
18+
* Beginning-of-line indentation via tabs, not spaces.
19+
20+
* Preprocessor macros are always UPPERCASE.
21+
There are a few grandfathered exceptions: assert, panic,
22+
static_assert, offsetof.
23+
24+
* Pointer types have spaces: (uint16_t *) not (uint16_t*).
25+
26+
* Multi-word names are lower_case_with_underscores.
27+
28+
* Comments in imported code are usually C /* ... */ comments.
29+
Comments in new code are C++ style //.
30+
31+
* In a function definition, the function name starts a new line.
32+
Then you can grep -n '^foo' */*.c to find the definition of foo.
33+
34+
* Functions that take no arguments are declared f(void) not f().
35+
36+
The included .dir-locals.el file will automatically set up the basic
37+
indentation style in Emacs.

0 commit comments

Comments
 (0)