Skip to content

Commit

Permalink
lab1
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Cutler committed Aug 31, 2016
0 parents commit a7725ea
Show file tree
Hide file tree
Showing 46 changed files with 5,897 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
((nil
(indent-tabs-mode . t)
(tab-width . 8))
(c-mode
(c-file-style . "bsd")
(c-basic-offset . 8))
(shell-mode
(sh-basic-offset . 8)
(sh-indentation . 8))
(python-mode
(indent-tabs-mode . nil))
)
30 changes: 30 additions & 0 deletions .gdbinit.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
set $lastcs = -1

define hook-stop
# There doesn't seem to be a good way to detect if we're in 16- or
# 32-bit mode, but we always run with CS == 8 in 32-bit mode.
if $cs == 8 || $cs == 27
if $lastcs != 8 && $lastcs != 27
set architecture i386
end
x/i $pc
else
if $lastcs == -1 || $lastcs == 8 || $lastcs == 27
set architecture i8086
end
# Translate the segment:offset into a physical address
printf "[%4x:%4x] ", $cs, $eip
x/i $cs*16+$eip
end
set $lastcs = $cs
end

echo + target remote localhost:1234\n
target remote localhost:1234

# If this fails, it's probably because your GDB doesn't support ELF.
# Look at the tools page at
# http://pdos.csail.mit.edu/6.828/2009/tools.html
# for instructions on building GDB with ELF support.
echo + symbol-file obj/kern/kernel\n
symbol-file obj/kern/kernel
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/obj
/jos.in
/jos.log
/jos.out
/jos.out.*
/jos.cmd
/.gdbinit
/wget.log
/qemu.pcap
/qemu.pcap.*
/qemu.out
/qemu.log
/gradelib.pyc
/lab?-handin.tar.gz
/lab?/
/sol?/
/myapi.key
37 changes: 37 additions & 0 deletions CODING
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
JOS CODING STANDARDS

It's easier on everyone if all authors working on a shared
code base are consistent in the way they write their programs.
We have the following conventions in our code:

* No space after the name of a function in a call
For example, printf("hello") not printf ("hello").

* One space after keywords "if", "for", "while", "switch".
For example, if (x) not if(x).

* Space before braces.
For example, if (x) { not if (x){.

* 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.

* Pointer types have spaces: (uint16_t *) not (uint16_t*).

* Multi-word names are lower_case_with_underscores.

* Comments in imported code are usually C /* ... */ comments.
Comments in new code are C++ style //.

* In a function definition, the function name starts a new line.
Then you can grep -n '^foo' */*.c to find the definition of foo.

* Functions that take no arguments are declared f(void) not f().

The included .dir-locals.el file will automatically set up the basic
indentation style in Emacs.
Loading

0 comments on commit a7725ea

Please sign in to comment.