pintos-anon
19 years agoRedo makefiles.
Ben Pfaff [Sun, 5 Sep 2004 21:55:24 +0000 (21:55 +0000)]
Redo makefiles.
Adjust all #include lines appropriately.

19 years agoNicer way to generate kernel.lds.s.
Ben Pfaff [Sun, 5 Sep 2004 16:34:36 +0000 (16:34 +0000)]
Nicer way to generate kernel.lds.s.

19 years ago%#X uses 0X not 0x.
Ben Pfaff [Sun, 5 Sep 2004 16:29:37 +0000 (16:29 +0000)]
%#X uses 0X not 0x.

19 years agoLicense info.
Ben Pfaff [Sun, 5 Sep 2004 08:49:31 +0000 (08:49 +0000)]
License info.

19 years agoAdd license info.
Ben Pfaff [Sun, 5 Sep 2004 08:49:16 +0000 (08:49 +0000)]
Add license info.

19 years agoSystem call interface.
Ben Pfaff [Sun, 5 Sep 2004 08:30:04 +0000 (08:30 +0000)]
System call interface.

19 years agoHandle bit_cnt of 0 properly.
Ben Pfaff [Sun, 5 Sep 2004 08:29:42 +0000 (08:29 +0000)]
Handle bit_cnt of 0 properly.

19 years agoDon't try to allocate file that's too big in filehdr_allocate.
Ben Pfaff [Sun, 5 Sep 2004 08:29:30 +0000 (08:29 +0000)]
Don't try to allocate file that's too big in filehdr_allocate.

19 years agofile_write_at() mustn't free bounce buffer.
Ben Pfaff [Sun, 5 Sep 2004 08:14:47 +0000 (08:14 +0000)]
file_write_at() mustn't free bounce buffer.

19 years agofree() on a null pointer is a no-op.
Ben Pfaff [Sun, 5 Sep 2004 08:14:23 +0000 (08:14 +0000)]
free() on a null pointer is a no-op.

19 years agoFix some new printf bugs.
Ben Pfaff [Sun, 5 Sep 2004 08:12:37 +0000 (08:12 +0000)]
Fix some new printf bugs.

19 years agoAdd comments.
Ben Pfaff [Sun, 5 Sep 2004 07:59:21 +0000 (07:59 +0000)]
Add comments.

19 years agoReorganize.
Ben Pfaff [Sun, 5 Sep 2004 07:58:46 +0000 (07:58 +0000)]
Reorganize.
Add strnlen().
Add comments.
Remove nonstandard types in parse_conversion().
Use 4-digit grouping for hexadecimal with %'.
Add rest of ctype functions.

19 years agoAdd comments.
Ben Pfaff [Sun, 5 Sep 2004 07:56:32 +0000 (07:56 +0000)]
Add comments.
Add assertions.
Make dir_destroy() do nothing on null pointer.
Rename FILENAME_LEN_MAX to NAME_MAX.
Make dir_add() fail too-long names.
Free structure on failure in filehdr_allocate().
Implement filehdr_print().
Add copyright notice to filesys.c.
Change %L to %ll--it's standard!

19 years agoAdd copyright notice to synch.h.
Ben Pfaff [Sun, 5 Sep 2004 07:53:53 +0000 (07:53 +0000)]
Add copyright notice to synch.h.
Reuse list_elem in struct thread for semaphore's wait list.
Add comments.

19 years agoDocument strtok_r().
Ben Pfaff [Sat, 4 Sep 2004 19:52:45 +0000 (19:52 +0000)]
Document strtok_r().

19 years agoAdd comments.
Ben Pfaff [Fri, 3 Sep 2004 06:46:08 +0000 (06:46 +0000)]
Add comments.

19 years agoAdd hash.c to lib sources (!).
Ben Pfaff [Fri, 3 Sep 2004 06:45:20 +0000 (06:45 +0000)]
Add hash.c to lib sources (!).

19 years agoAdd comments.
Ben Pfaff [Fri, 3 Sep 2004 06:44:52 +0000 (06:44 +0000)]
Add comments.

19 years agoComments.
Ben Pfaff [Fri, 3 Sep 2004 06:33:35 +0000 (06:33 +0000)]
Comments.

19 years agoReorganize, add comments.
Ben Pfaff [Fri, 3 Sep 2004 06:25:44 +0000 (06:25 +0000)]
Reorganize, add comments.

19 years agoAdd list_head(), list_tail().
Ben Pfaff [Fri, 3 Sep 2004 06:25:36 +0000 (06:25 +0000)]
Add list_head(), list_tail().

19 years agoAdd comments.
Ben Pfaff [Fri, 3 Sep 2004 05:19:47 +0000 (05:19 +0000)]
Add comments.

19 years agoImprove comment.
Ben Pfaff [Fri, 3 Sep 2004 02:32:44 +0000 (02:32 +0000)]
Improve comment.

19 years agoReorganize.
Ben Pfaff [Thu, 2 Sep 2004 23:53:23 +0000 (23:53 +0000)]
Reorganize.

19 years agoAdd comments.
Ben Pfaff [Thu, 2 Sep 2004 23:52:22 +0000 (23:52 +0000)]
Add comments.
Rename bitmap_storage_size() as bitmap_file_size(), make conditional
on FILESYS.

19 years agoDestroy PT pages in addrspace_destroy().
Ben Pfaff [Thu, 2 Sep 2004 23:28:07 +0000 (23:28 +0000)]
Destroy PT pages in addrspace_destroy().

19 years agoReorganization, comments.
Ben Pfaff [Thu, 2 Sep 2004 23:27:56 +0000 (23:27 +0000)]
Reorganization, comments.

19 years agoUpdate.
Ben Pfaff [Thu, 2 Sep 2004 22:53:58 +0000 (22:53 +0000)]
Update.

19 years agoSource file origins.
Ben Pfaff [Thu, 2 Sep 2004 22:53:05 +0000 (22:53 +0000)]
Source file origins.

19 years agoFix leak. Add comments. Restructure slightly.
Ben Pfaff [Thu, 2 Sep 2004 22:41:32 +0000 (22:41 +0000)]
Fix leak.  Add comments.  Restructure slightly.

19 years agoChange --gstabs+ to --gstabs in ASFLAGS to support older assemblers.
Ben Pfaff [Thu, 2 Sep 2004 22:09:56 +0000 (22:09 +0000)]
Change --gstabs+ to --gstabs in ASFLAGS to support older assemblers.

19 years agoAdd comments.
Ben Pfaff [Thu, 2 Sep 2004 22:04:57 +0000 (22:04 +0000)]
Add comments.

19 years agoMake linking of start.S less brittle.
Ben Pfaff [Thu, 2 Sep 2004 21:50:25 +0000 (21:50 +0000)]
Make linking of start.S less brittle.

19 years agoAdd comments.
Ben Pfaff [Thu, 2 Sep 2004 21:40:16 +0000 (21:40 +0000)]
Add comments.

19 years agoDon't destroy current thread's pagedir before activating a different
Ben Pfaff [Thu, 2 Sep 2004 21:03:03 +0000 (21:03 +0000)]
Don't destroy current thread's pagedir before activating a different
one (!).
thread_wake() needs to run with interrupts off.

19 years agoComments.
Ben Pfaff [Thu, 2 Sep 2004 20:59:49 +0000 (20:59 +0000)]
Comments.

19 years agoActivate the base page directory if pagedir_activate() is passed a
Ben Pfaff [Thu, 2 Sep 2004 20:59:40 +0000 (20:59 +0000)]
Activate the base page directory if pagedir_activate() is passed a
null pointer.

19 years agoRedo and improve thread scheduling startup.
Ben Pfaff [Thu, 2 Sep 2004 08:12:53 +0000 (08:12 +0000)]
Redo and improve thread scheduling startup.
In the process make it possible to use locks before the preemptive
scheduler is turned on.
This lets us add locking to the page allocator.

19 years agoRewrite to suck slightly less.
Ben Pfaff [Thu, 2 Sep 2004 05:54:53 +0000 (05:54 +0000)]
Rewrite to suck slightly less.
Add comments.

19 years agoAdd comments.
Ben Pfaff [Thu, 2 Sep 2004 04:16:24 +0000 (04:16 +0000)]
Add comments.

19 years agoActually initialize IDT in intr_init (!).
Ben Pfaff [Thu, 2 Sep 2004 04:16:12 +0000 (04:16 +0000)]
Actually initialize IDT in intr_init (!).

19 years agoEnable interrupts after reading CR2 in page fault handler.
Ben Pfaff [Thu, 2 Sep 2004 04:03:53 +0000 (04:03 +0000)]
Enable interrupts after reading CR2 in page fault handler.

19 years agoAdd comments.
Ben Pfaff [Thu, 2 Sep 2004 04:01:57 +0000 (04:01 +0000)]
Add comments.

19 years agoRemove unneeded stuff.
Ben Pfaff [Thu, 2 Sep 2004 03:55:21 +0000 (03:55 +0000)]
Remove unneeded stuff.

19 years agoAdd page fault skeleton.
Ben Pfaff [Thu, 2 Sep 2004 03:55:15 +0000 (03:55 +0000)]
Add page fault skeleton.

19 years agoMove user exception support into userprog.
Ben Pfaff [Thu, 2 Sep 2004 03:25:54 +0000 (03:25 +0000)]
Move user exception support into userprog.

19 years agoOnly call addrspace_destroy() if USERPROG.
Ben Pfaff [Wed, 1 Sep 2004 22:55:29 +0000 (22:55 +0000)]
Only call addrspace_destroy() if USERPROG.

19 years agoImprove code.
Ben Pfaff [Wed, 1 Sep 2004 22:52:25 +0000 (22:52 +0000)]
Improve code.

19 years agoSet CR0_WP in CR0.
Ben Pfaff [Wed, 1 Sep 2004 22:52:13 +0000 (22:52 +0000)]
Set CR0_WP in CR0.

19 years agoMisc cleanups in init, thread.
Ben Pfaff [Wed, 1 Sep 2004 22:36:36 +0000 (22:36 +0000)]
Misc cleanups in init, thread.

19 years agoAdd assert.
Ben Pfaff [Wed, 1 Sep 2004 22:36:24 +0000 (22:36 +0000)]
Add assert.

19 years agoBreak TSS out of GDT.
Ben Pfaff [Wed, 1 Sep 2004 22:25:56 +0000 (22:25 +0000)]
Break TSS out of GDT.

19 years agoBreak GDT, TSS out of init.c, mmu.h.
Ben Pfaff [Wed, 1 Sep 2004 22:13:26 +0000 (22:13 +0000)]
Break GDT, TSS out of init.c, mmu.h.

19 years agoRemove lots of unused #define's from mmu.h.
Ben Pfaff [Wed, 1 Sep 2004 21:43:44 +0000 (21:43 +0000)]
Remove lots of unused #define's from mmu.h.

19 years agoClean up interrupts.[ch].
Ben Pfaff [Wed, 1 Sep 2004 21:43:20 +0000 (21:43 +0000)]
Clean up interrupts.[ch].

19 years agoAdd comments.
Ben Pfaff [Wed, 1 Sep 2004 06:14:50 +0000 (06:14 +0000)]
Add comments.

19 years agoMake interrupt.h names more regular.
Ben Pfaff [Wed, 1 Sep 2004 06:00:50 +0000 (06:00 +0000)]
Make interrupt.h names more regular.

19 years agoIntegrate struct addrspace into struct thread.
Ben Pfaff [Wed, 1 Sep 2004 05:52:00 +0000 (05:52 +0000)]
Integrate struct addrspace into struct thread.

19 years agoClean up threads.
Ben Pfaff [Wed, 1 Sep 2004 05:38:55 +0000 (05:38 +0000)]
Clean up threads.

19 years agos/disk_sector_no/disk_sector_t/g
Ben Pfaff [Wed, 1 Sep 2004 04:02:22 +0000 (04:02 +0000)]
s/disk_sector_no/disk_sector_t/g

19 years agoFix PRDSNu.
Ben Pfaff [Wed, 1 Sep 2004 03:58:03 +0000 (03:58 +0000)]
Fix PRDSNu.

19 years agoTweak.
Ben Pfaff [Wed, 1 Sep 2004 03:56:22 +0000 (03:56 +0000)]
Tweak.

19 years agoDump interrupt frame info on user fault.
Ben Pfaff [Wed, 1 Sep 2004 01:16:42 +0000 (01:16 +0000)]
Dump interrupt frame info on user fault.

19 years agoImprove comments.
Ben Pfaff [Wed, 1 Sep 2004 01:16:25 +0000 (01:16 +0000)]
Improve comments.

19 years agoClean up disk layer.
Ben Pfaff [Tue, 31 Aug 2004 23:54:24 +0000 (23:54 +0000)]
Clean up disk layer.

19 years agoUpdate .cvsignore.
Ben Pfaff [Tue, 31 Aug 2004 22:07:49 +0000 (22:07 +0000)]
Update .cvsignore.

19 years agoInitial version.
Ben Pfaff [Tue, 31 Aug 2004 22:07:01 +0000 (22:07 +0000)]
Initial version.

19 years agoAdd fsutil.c.
Ben Pfaff [Tue, 31 Aug 2004 22:05:24 +0000 (22:05 +0000)]
Add fsutil.c.

19 years agoClean up threads.
Ben Pfaff [Tue, 31 Aug 2004 22:05:16 +0000 (22:05 +0000)]
Clean up threads.

19 years agoUse __attribute__ directly.
Ben Pfaff [Tue, 31 Aug 2004 22:04:56 +0000 (22:04 +0000)]
Use __attribute__ directly.

19 years agoAdd LOADER_CMD_LINE_LEN.
Ben Pfaff [Tue, 31 Aug 2004 22:04:45 +0000 (22:04 +0000)]
Add LOADER_CMD_LINE_LEN.

19 years agoImplement command line arguments.
Ben Pfaff [Tue, 31 Aug 2004 22:04:29 +0000 (22:04 +0000)]
Implement command line arguments.

19 years agoAllow user to provide random seed to random_init().
Ben Pfaff [Tue, 31 Aug 2004 22:04:08 +0000 (22:04 +0000)]
Allow user to provide random seed to random_init().

19 years agoAdd atoi().
Ben Pfaff [Tue, 31 Aug 2004 22:03:49 +0000 (22:03 +0000)]
Add atoi().
Add a hex_dump() argument that specifies whether to include ASCII.
Mark vsnprintf(), vprintk() with PRINTF_FORMAT.

19 years agoDebug. Add bitmap_dump().
Ben Pfaff [Tue, 31 Aug 2004 22:01:42 +0000 (22:01 +0000)]
Debug.  Add bitmap_dump().

19 years agoAdd filesys_list(), filesys_dump().
Ben Pfaff [Tue, 31 Aug 2004 22:01:25 +0000 (22:01 +0000)]
Add filesys_list(), filesys_dump().

19 years agoAdd dir_list(), dir_dump().
Ben Pfaff [Tue, 31 Aug 2004 22:01:10 +0000 (22:01 +0000)]
Add dir_list(), dir_dump().

19 years agoAdd DEBUG() macro for debugging that can be turned on and off with a
Ben Pfaff [Tue, 31 Aug 2004 22:00:54 +0000 (22:00 +0000)]
Add DEBUG() macro for debugging that can be turned on and off with a
command line option, and associated support.
Rename panic() to PANIC().  Update references.
Rename backtrace() to debug_backtrace().

19 years agoClean up threads.c.
Ben Pfaff [Tue, 31 Aug 2004 06:39:54 +0000 (06:39 +0000)]
Clean up threads.c.

19 years agoClean up threads.c.
Ben Pfaff [Tue, 31 Aug 2004 05:57:18 +0000 (05:57 +0000)]
Clean up threads.c.

19 years agoClean up a little.
Ben Pfaff [Tue, 31 Aug 2004 05:34:25 +0000 (05:34 +0000)]
Clean up a little.

19 years agoUpdate comment.
Ben Pfaff [Tue, 31 Aug 2004 05:12:57 +0000 (05:12 +0000)]
Update comment.

19 years agoMark thread_start() NO_RETURN.
Ben Pfaff [Tue, 31 Aug 2004 05:12:41 +0000 (05:12 +0000)]
Mark thread_start() NO_RETURN.

19 years agoSmall loader cleanups.
Ben Pfaff [Tue, 31 Aug 2004 04:09:44 +0000 (04:09 +0000)]
Small loader cleanups.

19 years agoCheck all return values.
Ben Pfaff [Tue, 31 Aug 2004 03:42:27 +0000 (03:42 +0000)]
Check all return values.

19 years agoUse Linux kernel trick of giving an .lds file a .S extension to get it
Ben Pfaff [Tue, 31 Aug 2004 03:23:39 +0000 (03:23 +0000)]
Use Linux kernel trick of giving an .lds file a .S extension to get it
preprocessed.

19 years agoDon't include malloc.h.
Ben Pfaff [Tue, 31 Aug 2004 03:22:39 +0000 (03:22 +0000)]
Don't include malloc.h.

19 years agoAdd some missing dependencies.
Ben Pfaff [Tue, 31 Aug 2004 02:55:58 +0000 (02:55 +0000)]
Add some missing dependencies.

19 years agoUpdate comments, put LOADER_PHYS_BASE back at 3 GB.
Ben Pfaff [Tue, 31 Aug 2004 02:55:48 +0000 (02:55 +0000)]
Update comments, put LOADER_PHYS_BASE back at 3 GB.

19 years agoDon't use <string.h>.
Ben Pfaff [Tue, 31 Aug 2004 01:04:27 +0000 (01:04 +0000)]
Don't use <string.h>.

19 years agoGet rid of backdoor.
Ben Pfaff [Tue, 31 Aug 2004 01:04:15 +0000 (01:04 +0000)]
Get rid of backdoor.

19 years agoNo FILESYS_STUB anymore.
Ben Pfaff [Tue, 31 Aug 2004 01:02:34 +0000 (01:02 +0000)]
No FILESYS_STUB anymore.

19 years agoUse lib.h instead of <string.h>.
Ben Pfaff [Tue, 31 Aug 2004 01:02:24 +0000 (01:02 +0000)]
Use lib.h instead of <string.h>.

19 years agoBase on loader.
Ben Pfaff [Tue, 31 Aug 2004 01:02:00 +0000 (01:02 +0000)]
Base on loader.

19 years agoMake loader use constants.
Ben Pfaff [Tue, 31 Aug 2004 01:01:51 +0000 (01:01 +0000)]
Make loader use constants.

19 years agoNow kernel.lds.in is preprocessed to get kernel.lds.
Ben Pfaff [Tue, 31 Aug 2004 01:00:56 +0000 (01:00 +0000)]
Now kernel.lds.in is preprocessed to get kernel.lds.

19 years agoDeclare argc, argv.
Ben Pfaff [Tue, 31 Aug 2004 01:00:37 +0000 (01:00 +0000)]
Declare argc, argv.

19 years agoSplit RAM initialization into function.
Ben Pfaff [Tue, 31 Aug 2004 01:00:19 +0000 (01:00 +0000)]
Split RAM initialization into function.

19 years agoAdd strtok_r().
Ben Pfaff [Tue, 31 Aug 2004 00:59:23 +0000 (00:59 +0000)]
Add strtok_r().