Commit graph

47 commits

Author SHA1 Message Date
rsc
e6ffaa9d8e oops 2007-08-28 04:13:40 +00:00
rsc
f0d11fea82 Move keyboard code into kbd.c; add backspace handling. 2007-08-28 03:28:13 +00:00
rsc
558ab49f13 delete unnecessary #include lines 2007-08-27 23:26:33 +00:00
rsc
97ac612fb1 nits 2007-08-24 20:28:08 +00:00
rsc
fe5f50a03d fixes 2007-08-14 19:41:01 +00:00
rsc
5e8c5d8bb8 formatting; split kbd constants into kbd.h 2007-08-14 19:31:16 +00:00
rsc
b6095304b7 Make cp a magic symbol. 2007-08-10 16:37:27 +00:00
rsc
f2f062da61 check p->killed for long-lived sleeps 2007-08-08 10:29:42 +00:00
rsc
c664dd5d23 missing void 2007-08-08 09:32:39 +00:00
rsc
07018064bb add EOF handling to console_read - works with cat 2007-08-08 08:04:02 +00:00
rsc
5a71f93301 debugging rearrangements 2006-09-07 16:52:13 +00:00
rsc
ab17e3198b debugging prints 2006-09-07 15:45:38 +00:00
rsc
19297caf0d fix ide, pit interfaces 2006-09-07 15:29:54 +00:00
rsc
1dca3afbbb remove _ prefixes 2006-09-07 13:08:23 +00:00
kaashoek
f70172129c run without lapic and ioapic, if they are not present
if no lapic available, use 8253pit for clock
now xv6 runs both on qemu (uniprocessor) and bochs (uniprocessor and MP)
2006-09-07 01:37:58 +00:00
kaashoek
f9bc4452b5 nit in console interrupts 2006-09-07 00:00:33 +00:00
rsc
f552738889 no /* */ comments 2006-09-06 17:50:20 +00:00
rsc
9e9bcaf143 standardize various * conventions 2006-09-06 17:27:19 +00:00
rsc
a650c606fe spacing fixes: no tabs, 2-space indents (for rtm) 2006-09-06 17:04:06 +00:00
rsc
45854caa93 print "0" for null string 2006-09-06 16:38:39 +00:00
kaashoek
0b6ab8416e don't send keyboard interrupts to the second cpu, if we have only one cpu.
xv6 seems to work fine on uniprocessor now.
2006-09-03 17:34:09 +00:00
kaashoek
7abf49d2f2 remove duplication
don't use the same name for two different pieces of code
2006-09-03 15:39:29 +00:00
rtm
2b19190c13 clean up stale error checks and panics
delete unused functions
a few comments
2006-08-29 14:45:45 +00:00
kaashoek
8b58e81077 i/o redirection in sh
better parsing of sh commands (copied from jos sh)
cat: read from 1 if no args
sbrk system call, but untested
getpid system call
moved locks in keyboard intr, but why do we get intr w. null characters from keyboard?
2006-08-23 01:09:24 +00:00
kaashoek
e958c538fa commented out code for cwd 2006-08-15 15:53:46 +00:00
rtm
17a856577f init creates console, opens 0/1/2, runs sh
sh accepts 0-argument commands (like userfs)
reads from console
2006-08-11 13:55:18 +00:00
rtm
5be0039ce9 interrupts could be recursive since lapic_eoi() called before rti
so fast interrupts overflow the kernel stack
fix: cli() before lapic_eoi()
2006-08-10 22:08:14 +00:00
rtm
8a8be1b8c3 low-level keyboard input (not hooked up to /dev yet)
fix acquire() to cli() *before* incrementing nlock
make T_SYSCALL a trap gate, not an interrupt gate
sadly, various crashes if you hold down a keyboard key...
2006-08-10 02:07:10 +00:00
kaashoek
28d9ef04dd printf
convert userfs to use printf
bfree
ifree
writei
start on unlink
2006-08-10 01:28:57 +00:00
kaashoek
2601de0032 fix test program: don't close before writing
set fd to writeable on open for write
2006-08-09 17:25:10 +00:00
kaashoek
6fa5ffb56f devsw
checkpoint: write(fd,"hello\n",6) where fd is a console dev almost works
2006-08-09 16:04:04 +00:00
rtm
32630628a9 open() 2006-07-29 09:35:02 +00:00
rtm
2927081628 uint32_t -> uint &c 2006-07-20 09:07:53 +00:00
rsc
e0966f459f no more cons_putc; real_cons_putc -> cons_putc 2006-07-17 01:53:43 +00:00
rsc
b5ee516575 add uint and standardize on typedefs instead of unsigned 2006-07-17 01:52:13 +00:00
rsc
c54c79267f nitpicks 2006-07-17 01:25:22 +00:00
rsc
b75c11b20e add %s to cprintf for cons_puts 2006-07-16 16:00:03 +00:00
rsc
b53f99d0d2 standardize on #include "foo" not <foo> 2006-07-16 15:40:05 +00:00
rsc
6f2b626d28 remove non-idiomatic increment/decrement 2006-07-16 01:52:22 +00:00
rsc
856e1fc1ad Attempt to clean up newproc somewhat.
Also remove all calls to memcpy in favor of
memmove, which has defined semantics when
the ranges overlap.  The fact that memcpy was
working in console.c to scroll the screen is not
guaranteed by all implementations.
2006-07-16 01:47:40 +00:00
rsc
65bd8e139a New scheduler.
Removed cli and sti stack in favor of tracking
number of locks held on each CPU and explicit
conditionals in spinlock.c.
2006-07-16 01:15:28 +00:00
rtm
46bbd72f3e no more recursive locks
wakeup1() assumes you hold proc_table_lock
sleep(chan, lock) provides atomic sleep-and-release to wait for condition
ugly code in swtch/scheduler to implement new sleep
fix lots of bugs in pipes, wait, and exit
fix bugs if timer interrupt goes off in schedule()
console locks per line, not per byte
2006-07-15 12:03:57 +00:00
rtm
8148b6ee53 i think my cmpxchg use was wrong in acquire
nesting cli/sti: release shouldn't always enable interrupts
separate setup of lapic from starting of other cpus, so cpu() works earlier
flag to disable locking in console output
make locks work even when curproc==0
(still crashes in clock interrupt)
2006-07-12 11:15:38 +00:00
rtm
4e8f237be8 no more big kernel lock
succeeds at usertests.c pipe test
2006-07-12 01:48:35 +00:00
rsc
5ce9751cab Changes to allow use of native x86 ELF compilers, which on my
Linux 2.4 box using gcc 3.4.6 don't seem to follow the same
conventions as the i386-jos-elf-gcc compilers.
Can run make 'TOOLPREFIX=' or edit the Makefile.

curproc[cpu()] can now be NULL, indicating that no proc is running.
This seemed safer to me than having curproc[0] and curproc[1]
both pointing at proc[0] potentially.

The old implementation of swtch depended on the stack frame layout
used inside swtch being okay to return from on the other stack
(exactly the V6 you are not expected to understand this).
It also could be called in two contexts: at boot time, to schedule
the very first process, and later, on behalf of a process, to sleep
or schedule some other process.

I split this into two functions: scheduler and swtch.

The scheduler is now a separate never-returning function, invoked
by each cpu once set up.  The scheduler looks like:

	scheduler() {
		setjmp(cpu.context);

		pick proc to schedule
		blah blah blah

		longjmp(proc.context)
	}

The new swtch is intended to be called only when curproc[cpu()] is not NULL,
that is, only on behalf of a user proc.  It does:

	swtch() {
		if(setjmp(proc.context) == 0)
			longjmp(cpu.context)
	}

to save the current proc context and then jump over to the scheduler,
running on the cpu stack.

Similarly the system call stubs are now in assembly in usys.S to avoid
needing to know the details of stack frame layout used by the compiler.

Also various changes in the debugging prints.
2006-07-11 01:07:40 +00:00
rtm
bf49aedbed send console output to parallel port 2006-06-22 15:51:57 +00:00
rtm
55e95b16db import 2006-06-12 15:22:12 +00:00