Commit graph

59 commits

Author SHA1 Message Date
Frans Kaashoek 895af77fe6 check blockno passed to idestart 2015-04-10 07:15:06 -04:00
Frans Kaashoek c24ac5d763 Disentangle block size from the disk's sector size. Set block size to 1024 to show
that they can be different.  Clean up mkfs, simplifying specifying fs parameters,
remove some redundancy between fs and mkfs, and fix disk layout bugs. Call blocks
in the file system blocks instead of sectors.  Passes usertests for different
block sizes.
2015-04-03 08:22:02 -04:00
Robert Morris 2ae8392a5c make the book happy 2012-08-28 14:41:08 -04:00
Robert Morris a5fbfe418a clarify some FS comments 2011-10-11 06:41:37 -04:00
Frans Kaashoek 1ddfbbb194 Revert "Introduce and use sleeplocks instead of BUSY flags"
My changes have a race with re-used bufs and the code doesn't seem to get shorter
Keep the changes that fixed ip->off race

This reverts commit 3a5fa7ed90.

Conflicts:

	defs.h
	file.c
	file.h
2011-08-29 17:18:40 -04:00
Frans Kaashoek 3a5fa7ed90 Introduce and use sleeplocks instead of BUSY flags
Remove I_BUSY, B_BUSY, and intrans defs and usages
One spinlock per buf to avoid ugly loop in bget
fix race in filewrite (don't update f->off after releasing lock)
2011-08-26 10:08:29 -04:00
Frans Kaashoek 8a9b6dbd44 Make cross reference with text work 2011-08-25 14:39:09 -04:00
Frans Kaashoek 9aa0337dc1 Map kernel high
Very important to give qemu memory through PHYSTOP :(
2011-07-29 07:31:27 -04:00
Russ Cox cf4b1ad90b xv6: formatting, cleanup, rev5 (take 2) 2011-02-19 21:17:55 -05:00
Russ Cox 1a81e38b17 make new code like old code
Variable declarations at top of function,
separate from initialization.

Use == 0 instead of ! for checking pointers.

Consistent spacing around {, *, casts.

Declare 0-parameter functions as (void) not ().

Integer valued functions return -1 on failure, 0 on success.
2011-01-11 13:01:13 -05:00
Frans Kaashoek 40889627ba Initial version of single-cpu xv6 with page tables 2010-07-02 14:51:53 -04:00
Russ Cox 48755214c9 assorted fixes:
* rename c/cp to cpu/proc
 * rename cpu.context to cpu.scheduler
 * fix some comments
 * formatting for printout
2009-08-30 23:02:08 -07:00
rsc 34295f461a group locks into structs they protect.
few naming nits.
2009-05-31 05:12:21 +00:00
rsc c47bc4fd54 ide.c: make names more regular 2009-05-31 01:29:01 +00:00
rsc 2157576107 be consistent: no underscores in function names 2009-03-08 22:07:13 +00:00
rtm fbd8857d4d make new Homework 8 work 2007-08-30 18:21:35 +00:00
rsc eb52c7de1d comments; rename irq_ to pic_ 2007-08-28 19:04:36 +00:00
rsc 5516be1fed spaces around else for rtm 2007-08-28 18:37:41 +00:00
rsc c1b100e930 nits 2007-08-28 18:23:48 +00:00
rsc 2868ca0f37 comment non-check of cp->killed 2007-08-28 03:32:49 +00:00
rsc 558ab49f13 delete unnecessary #include lines 2007-08-27 23:26:33 +00:00
rsc d003d232fc Another attempt at the bio.c comment.
Rename B_WRITE to B_DIRTY and then let ide.c
maintain the B_VALID and B_DIRTY flags.
2007-08-27 14:09:30 +00:00
rsc d7b44dbcfc minor cleanups 2007-08-24 22:17:41 +00:00
rtm 8e88f9e2c6 comment nits 2007-08-24 19:52:49 +00:00
rtm 902b13f5d6 simplify ide queuing
nits in comments
2007-08-24 19:32:36 +00:00
rsc 8d0a83565a formatting, sleep bug fix 2007-08-14 18:46:29 +00:00
rsc 29ff8d495c ide_write unused => gone 2007-08-14 14:24:09 +00:00
rsc 50f8850366 move ide_intr lower 2006-09-08 14:33:27 +00:00
rsc 21eafd48e2 fix disk bug 2006-09-07 16:54:18 +00:00
rsc 19297caf0d fix ide, pit interfaces 2006-09-07 15:29:54 +00:00
rsc bb207a1d42 comments 2006-09-07 14:28:12 +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
rsc 96d467b3a9 more named constants 2006-09-06 17:54:29 +00:00
rsc 799c9176bc more tabs go away 2006-09-06 17:53:15 +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
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 2aa4c3bc29 complain if no disk 1
lots of cleanup
2006-08-30 18:55:06 +00:00
rtm 9e5970d596 link() 2006-08-13 02:12:44 +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 939f9edeac iread for T_DEV
O_RDWR, etc.
create file
2006-08-09 19:25:20 +00:00
rtm 0e84a0ec6e fix race in holding() check in acquire()
give cpu1 a TSS and gdt for when it enters scheduler()
and a pseudo proc[] entry for each cpu
cpu0 waits for each other cpu to start up
read() for files
2006-08-08 19:58:06 +00:00
kaashoek 104207726b bwrite 2006-08-07 01:38:46 +00:00
kaashoek 8ec6530fee generalize async read to support write too 2006-08-06 20:28:15 +00:00
kaashoek c8b29f6d03 better interrupt plan---this one appears to work
ioapic
2006-08-04 18:12:31 +00:00
rtm 32630628a9 open() 2006-07-29 09:35:02 +00:00
kaashoek e46fb46fcf acquire+release ide_lock in ide_intr 2006-07-29 01:20:15 +00:00
rtm 11a9947f1a bread
iget
mkfs makes a file system image
put this in your .bochsrc:
ata0-slave: type=disk, mode=flat, path="fs.img", cylinders=1024, heads=1, spt=1
2006-07-21 13:18:04 +00:00