projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
8c1ab5b
)
Basic disk test code.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 29 Aug 2004 21:50:07 +0000
(21:50 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 29 Aug 2004 21:50:07 +0000
(21:50 +0000)
src/threads/init.c
patch
|
blob
|
history
diff --git
a/src/threads/init.c
b/src/threads/init.c
index 54a98d256236eb54fa2ba1a515949285b10d8085..8702da418738fe8df411906289bd0a6e9ca45b12 100644
(file)
--- a/
src/threads/init.c
+++ b/
src/threads/init.c
@@
-33,7
+33,17
@@
void power_off (void);
static void
main_thread (void *aux UNUSED)
{
static void
main_thread (void *aux UNUSED)
{
+ struct disk *hda;
disk_init ();
disk_init ();
+ hda = disk_get (0);
+ if (hda != NULL)
+ {
+ char buf[DISK_SECTOR_SIZE];
+ disk_read (hda, 0, buf);
+ hex_dump (buf, sizeof buf);
+ }
+ else
+ printk ("no hda\n");
thread_execute ("a.out");
}
thread_execute ("a.out");
}
@@
-46,16
+56,16
@@
main (void)
/* Clear out the BSS segment. */
memset (&__bss_start, 0, &_end - &__bss_start);
/* Clear out the BSS segment. */
memset (&__bss_start, 0, &_end - &__bss_start);
+ /* Initialize components needed by printk() very early. */
vga_init ();
serial_init ();
vga_init ();
serial_init ();
+ printk ("Booting cnachos86...\n");
/* Calculate how much RAM the kernel uses, and find out from
the bootloader how much RAM this machine has. */
kernel_pages = (&_end - &_text + 4095) / 4096;
ram_pages = *(uint32_t *) (0x7e00 - 6);
/* Calculate how much RAM the kernel uses, and find out from
the bootloader how much RAM this machine has. */
kernel_pages = (&_end - &_text + 4095) / 4096;
ram_pages = *(uint32_t *) (0x7e00 - 6);
-
- printk ("Initializing nachos-x86, %d kB RAM detected.\n",
- ram_pages * 4);
+ printk ("ram: detected %'d kB.\n", ram_pages * 4);
/* Memory from the end of the kernel through the end of memory
is free. Give it to the page allocator. */
/* Memory from the end of the kernel through the end of memory
is free. Give it to the page allocator. */