From 74e4fdb89b78bdc0c4d6d3b7c7d83934c665cfbb Mon Sep 17 00:00:00 2001 From: AceVest Date: Fri, 1 Aug 2014 20:49:01 +0800 Subject: [PATCH] wording modify --- bin/shell.c | 2 +- boot/cmdline.c | 3 + drivers/ide.c | 12 +- fs/ext2.c | 2 +- include/page.h | 1 - include/system.h | 5 + kernel/clock.c | 2 +- kernel/init.c | 1 + kernel/pci.c | 283 ++++++++++++++++++++++++----------------------- kernel/setup.c | 10 +- kernel/system.c | 14 ++- mm/buddy.c | 2 +- mm/mm.c | 6 +- mm/page.c | 5 - mm/slub.c | 2 +- scripts/grub.cfg | 2 +- 16 files changed, 187 insertions(+), 165 deletions(-) diff --git a/bin/shell.c b/bin/shell.c index 295ea12..2a05453 100644 --- a/bin/shell.c +++ b/bin/shell.c @@ -18,7 +18,7 @@ int main() while(1) { - printf("shell#"); + printf("shell# "); char cmd[256]; read(0, cmd, 256); diff --git a/boot/cmdline.c b/boot/cmdline.c index 2476d30..4dab581 100644 --- a/boot/cmdline.c +++ b/boot/cmdline.c @@ -43,4 +43,7 @@ void parse_cmdline(const char *cmdline) assert(value[0]=='h' && value[1]=='d' && value[2] == 'a'); system.root_dev = MAKE_DEV(DEV_MAJOR_HDA, atoi(value+3)); printk("root device %08x\n", system.root_dev); + + get_value("delay", value); + system.delay = atoi(value); } diff --git a/drivers/ide.c b/drivers/ide.c index 4cf9976..bd21d89 100644 --- a/drivers/ide.c +++ b/drivers/ide.c @@ -222,8 +222,8 @@ void init_pci_controller(unsigned int classcode) pci_device_t *pci = pci_find_device_by_classcode(classcode); if(pci != 0 && pci->intr_line < 16) { - printk("Found PCI Vendor %04x Device %04x Class %04x IntrLine %d\n", pci->vendor, pci->device, pci->classcode, pci->intr_line); - printl(17, "Found PCI Vendor %04x Device %04x Class %04x IntrLine %d", pci->vendor, pci->device, pci->classcode, pci->intr_line); + printk("found pci vendor %04x device %04x class %04x intr %d\n", pci->vendor, pci->device, pci->classcode, pci->intr_line); + printl(17, "found pci vendor %04x device %04x class %04x intr %d", pci->vendor, pci->device, pci->classcode, pci->intr_line); ide_pci_init(pci); drv.pci = pci; } @@ -413,12 +413,12 @@ void ide_read_extended_partition(u64_t lba, unsigned int inx) { drv.part[inx].lba_start = part_lba; drv.part[inx].lba_end = part_lba+part_scnt; - printk(" Logic Partition[%02d] [%02x] LbaBase %10d LbaEnd %10d\n", inx, p->type, (unsigned int)(drv.part[inx].lba_start), (unsigned int)(drv.part[inx].lba_end - 1)); + printk(" logic partition[%02d] [%02x] LBA base %10d end %10d\n", inx, p->type, (unsigned int)(drv.part[inx].lba_start), (unsigned int)(drv.part[inx].lba_end - 1)); } else { part_lba = drv.ext_lba_base + p->lba; - printk(" Extended [%02x] LbaBase %10d LbaEnd %10d\n", p->type, (unsigned int)(part_lba), (unsigned int)(part_lba+part_scnt - 1)); + printk(" extended [%02x] LBA base %10d end %10d\n", p->type, (unsigned int)(part_lba), (unsigned int)(part_lba+part_scnt - 1)); ide_read_extended_partition(part_lba, inx+1); } } @@ -428,7 +428,7 @@ void ide_read_extended_partition(u64_t lba, unsigned int inx) void ide_read_partition() { - printk("Reading Partitions....\n"); + printk("reading partitions....\n"); unsigned int i; char *buf = kmalloc(512, 0); if(buf == 0) @@ -467,7 +467,7 @@ void ide_read_partition() } } - printk("Primary Partition[%02d] [%02x] LbaBase %10d LbaEnd %10d\n", i, p->type, (unsigned int)(part_lba), (unsigned int)(part_lba+part_scnt - 1)); + printk("primary partition[%02d] [%02x] LBA base %10d end %10d\n", i, p->type, (unsigned int)(part_lba), (unsigned int)(part_lba+part_scnt - 1)); } kfree(buf); diff --git a/fs/ext2.c b/fs/ext2.c index 9bff1cf..1d00ddc 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -272,7 +272,7 @@ void ext2_setup_fs() unsigned int i; for(i=0; ibg_inode_table, ext2_gd(i)->bg_free_blocks_count, ext2_gd(i)->bg_free_inodes_count, ext2_gd(i)->bg_used_dirs_count); } diff --git a/include/page.h b/include/page.h index 96cdec5..0e94cec 100644 --- a/include/page.h +++ b/include/page.h @@ -66,7 +66,6 @@ typedef unsigned long pte_t; #define PFN_DW(addr) ((addr) >> PAGE_SHIFT) #define MAX_ORDER (11) -#define MAX_OLD_ORDER (11) #define LOAD_CR3(pde) asm("movl %%edx, %%cr3"::"d"(va2pa(pde))) diff --git a/include/system.h b/include/system.h index ac2b5ff..adb24f6 100644 --- a/include/system.h +++ b/include/system.h @@ -218,10 +218,15 @@ typedef struct system const char *cmdline; u32 debug; + + u32 delay; } System, *pSystem; + extern System system; +void system_delay(); + #define pgmap system.page_map #endif diff --git a/kernel/clock.c b/kernel/clock.c index 884e49e..3c565d3 100644 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -25,5 +25,5 @@ void clk_handler(unsigned int irq, pt_regs_t * regs, void *dev_id) jiffies++; //printd("^"); - printl(MPL_CLOCK, "clock:%d", jiffies); + printl(MPL_CLOCK, "clock irq:%d", jiffies); } diff --git a/kernel/init.c b/kernel/init.c index 6ac3a7e..5c8156e 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -64,6 +64,7 @@ void root_task_entry() kernel_task(init_task_entry); kernel_task(user_task_entry); + kernel_task(init_task_entry); int cnt = 0; diff --git a/kernel/pci.c b/kernel/pci.c index a42a6a9..81113c4 100644 --- a/kernel/pci.c +++ b/kernel/pci.c @@ -65,8 +65,10 @@ void scan_pci_bus(int bus) u32 cmd; u32 v; int i; - printk("scanning PCI bus %d\n", bus); + printk("scanning pci bus %d\n", bus); + system_delay(); + for(dev=0; dev<32; dev++) { for(devfn =0; devfn<8; devfn++) @@ -167,7 +169,7 @@ void dump_pci_dev() list_for_each(p, &pci_devs) { pci_device_t *pci = list_entry(p, pci_device_t, list); - printk("Vendor %04x Device %04x Class %04x Intr %02d ", pci->vendor, pci->device, pci->classcode, pci->intr_line); + printk("vendor %04x device %04x class %04x intr %02d ", pci->vendor, pci->device, pci->classcode, pci->intr_line); printk("%s\n", pci_get_info(pci->classcode, pci->progif)); continue; switch(pci->hdr_type) @@ -242,147 +244,148 @@ typedef struct pci_info { unsigned long code; unsigned int flag; const char *info; + const char *detail; } pci_info_t; pci_info_t pci_info[] = { - { 0x000000, 0, "Any device except for VGA-Compatible devices" }, - { 0x000100, 0, "VGA-Compatible Device" }, - { 0x010000, 0, "SCSI Bus Controller" }, - { 0x0101, 1, "IDE Controller" }, - { 0x010200, 0, "Floppy Disk Controller" }, - { 0x010300, 0, "IPI Bus Controller" }, - { 0x010400, 0, "RAID Controller" }, - { 0x010520, 0, "ATA Controller (Single DMA)" }, - { 0x010530, 0, "ATA Controller (Chained DMA)" }, - { 0x010600, 0, "Serial ATA (Vendor Specific Interface)" }, - { 0x010601, 0, "Serial ATA (AHCI 1.0)" }, - { 0x010700, 0, "Serial Attached SCSI (SAS)" }, - { 0x018000, 0, "Other Mass Storage Controller" }, - { 0x020000, 0, "Ethernet Controller" }, - { 0x020100, 0, "Token Ring Controller" }, - { 0x020200, 0, "FDDI Controller" }, - { 0x020300, 0, "ATM Controller" }, - { 0x020400, 0, "ISDN Controller" }, - { 0x020500, 0, "WorldFip Controller" }, - { 0x0206, 1, "PICMG 2.14 Multi Computing" }, - { 0x028000, 0, "Other Network Controller" }, - { 0x030000, 0, "VGA-Compatible Controller" }, - { 0x030001, 0, "8512-Compatible Controller" }, - { 0x030100, 0, "XGA Controller" }, - { 0x030200, 0, "3D Controller (Not VGA-Compatible)" }, - { 0x038000, 0, "Other Display Controller" }, - { 0x040000, 0, "Video Device" }, - { 0x040100, 0, "Audio Device" }, - { 0x040200, 0, "Computer Telephony Device" }, - { 0x048000, 0, "Other Multimedia Device" }, - { 0x050000, 0, "RAM Controller" }, - { 0x050100, 0, "Flash Controller" }, - { 0x058000, 0, "Other Memory Controller" }, - { 0x060000, 0, "Host Bridge" }, - { 0x060100, 0, "ISA Bridge" }, - { 0x060200, 0, "EISA Bridge" }, - { 0x060300, 0, "MCA Bridge" }, - { 0x060400, 0, "PCI-to-PCI Bridge" }, - { 0x060401, 0, "PCI-to-PCI Bridge (Subtractive Decode)" }, - { 0x060500, 0, "PCMCIA Bridge" }, - { 0x060600, 0, "NuBus Bridge" }, - { 0x060700, 0, "CardBus Bridge" }, - { 0x0608, 1, "RACEway Bridge" }, - { 0x060940, 0, "PCI-to-PCI Bridge (Semi-Transparent, Primary)" }, - { 0x060980, 0, "PCI-to-PCI Bridge (Semi-Transparent, Secondary)" }, - { 0x060A00, 0, "InfiniBrand-to-PCI Host Bridge" }, - { 0x068000, 0, "Other Bridge Device" }, - { 0x070000, 0, "Generic XT-Compatible Serial Controller" }, - { 0x070001, 0, "16450-Compatible Serial Controller" }, - { 0x070002, 0, "16550-Compatible Serial Controller" }, - { 0x070003, 0, "16650-Compatible Serial Controller" }, - { 0x070004, 0, "16750-Compatible Serial Controller" }, - { 0x070005, 0, "16850-Compatible Serial Controller" }, - { 0x070006, 0, "16950-Compatible Serial Controller" }, - { 0x070100, 0, "Parallel Port" }, - { 0x070101, 0, "Bi-Directional Parallel Port" }, - { 0x070102, 0, "ECP 1.X Compliant Parallel Port" }, - { 0x070103, 0, "IEEE 1284 Controller" }, - { 0x0701FE, 0, "IEEE 1284 Target Device" }, - { 0x070200, 0, "Multiport Serial Controller" }, - { 0x070300, 0, "Generic Modem" }, - { 0x070301, 0, "Hayes Compatible Modem (16450-Compatible Interface)" }, - { 0x070302, 0, "Hayes Compatible Modem (16550-Compatible Interface)" }, - { 0x070303, 0, "Hayes Compatible Modem (16650-Compatible Interface)" }, - { 0x070304, 0, "Hayes Compatible Modem (16750-Compatible Interface)" }, - { 0x070400, 0, "IEEE 488.1/2 (GPIB) Controller" }, - { 0x070500, 0, "Smart Card" }, - { 0x078000, 0, "Other Communications Device" }, - { 0x080000, 0, "Generic 8259 PIC" }, - { 0x080001, 0, "ISA PIC" }, - { 0x080002, 0, "EISA PIC" }, - { 0x080010, 0, "I/O APIC Interrupt Controller" }, - { 0x080020, 0, "I/O(x) APIC Interrupt Controller" }, - { 0x080100, 0, "Generic 8237 DMA Controller" }, - { 0x080101, 0, "ISA DMA Controller" }, - { 0x080102, 0, "EISA DMA Controller" }, - { 0x080200, 0, "Generic 8254 System Timer" }, - { 0x080201, 0, "ISA System Timer" }, - { 0x080202, 0, "EISA System Timer" }, - { 0x080300, 0, "Generic RTC Controller" }, - { 0x080301, 0, "ISA RTC Controller" }, - { 0x080400, 0, "Generic PCI Hot-Plug Controller" }, - { 0x088000, 0, "Other System Peripheral" }, - { 0x090000, 0, "Keyboard Controller" }, - { 0x090100, 0, "Digitizer" }, - { 0x090200, 0, "Mouse Controller" }, - { 0x090300, 0, "Scanner Controller" }, - { 0x090400, 0, "Gameport Controller (Generic)" }, - { 0x090410, 0, "Gameport Contrlller (Legacy)" }, - { 0x098000, 0, "Other Input Controller" }, - { 0x0A0000, 0, "Generic Docking Station" }, - { 0x0A8000, 0, "Other Docking Station" }, - { 0x0B0000, 0, "386 Processor" }, - { 0x0B0100, 0, "486 Processor" }, - { 0x0B0200, 0, "Pentium Processor" }, - { 0x0B1000, 0, "Alpha Processor" }, - { 0x0B2000, 0, "PowerPC Processor" }, - { 0x0B3000, 0, "MIPS Processor" }, - { 0x0B4000, 0, "Co-Processor" }, - { 0x0C0000, 0, "IEEE 1394 Controller (FireWire)" }, - { 0x0C0010, 0, "IEEE 1394 Controller (1394 OpenHCI Spec)" }, - { 0x0C0100, 0, "ACCESS.bus" }, - { 0x0C0200, 0, "SSA" }, - { 0x0C0300, 0, "USB (Universal Host Controller Spec)" }, - { 0x0C0310, 0, "USB (Open Host Controller Spec" }, - { 0x0C0320, 0, "USB2 Host Controller (Intel Enhanced Host Controller Interface)" }, - { 0x0C0380, 0, "USB" }, - { 0x0C03FE, 0, "USB (Not Host Controller)" }, - { 0x0C0400, 0, "Fibre Channel" }, - { 0x0C0500, 0, "SMBus" }, - { 0x0C0600, 0, "InfiniBand" }, - { 0x0C0700, 0, "IPMI SMIC Interface" }, - { 0x0C0701, 0, "IPMI Kybd Controller Style Interface" }, - { 0x0C0702, 0, "IPMI Block Transfer Interface" }, - { 0x0C0800, 0, "SERCOS Interface Standard (IEC 61491)" }, - { 0x0C0900, 0, "CANbus" }, - { 0x0D0000, 0, "iRDA Compatible Controller" }, - { 0x0D0100, 0, "Consumer IR Controller" }, - { 0x0D1000, 0, "RF Controller" }, - { 0x0D1100, 0, "Bluetooth Controller" }, - { 0x0D1200, 0, "Broadband Controller" }, - { 0x0D2000, 0, "Ethernet Controller (802.11a)" }, - { 0x0D2100, 0, "Ethernet Controller (802.11b)" }, - { 0x0D8000, 0, "Other Wireless Controller" }, - { 0x0E00, 1, "I20 Architecture" }, - { 0x0E0000, 0, "Message FIFO" }, - { 0x0F0100, 0, "TV Controller" }, - { 0x0F0200, 0, "Audio Controller" }, - { 0x0F0300, 0, "Voice Controller" }, - { 0x0F0400, 0, "Data Controller" }, - { 0x100000, 0, "Network and Computing Encrpytion/Decryption" }, - { 0x101000, 0, "Entertainment Encryption/Decryption" }, - { 0x108000, 0, "Other Encryption/Decryption" }, - { 0x110000, 0, "DPIO Modules" }, - { 0x110100, 0, "Performance Counters" }, - { 0x111000, 0, "Communications Syncrhonization Plus Time and Frequency Test/Measurment" }, - { 0x112000, 0, "Management Card" }, - { 0x118000, 0, "Other Data Acquisition/Signal Processing Controller" }, + { 0x000000, 0, "VGA-Compatible devices", "Any device except for VGA-Compatible devices" }, + { 0x000100, 0, "VGA-Compatible device", "VGA-Compatible Device" }, + { 0x010000, 0, "SCSI Bus Controller", "SCSI Bus Controller" }, + { 0x0101, 1, "IDE Controller", "IDE Controller" }, + { 0x010200, 0, "Floppy Disk Controller", "Floppy Disk Controller" }, + { 0x010300, 0, "IPI Bus Controller", "IPI Bus Controller" }, + { 0x010400, 0, "RAID Controller", "RAID Controller" }, + { 0x010520, 0, "ATA Controller", "ATA Controller (Single DMA)" }, + { 0x010530, 0, "ATA Controller", "ATA Controller (Chained DMA)" }, + { 0x010600, 0, "Serial ATA", "Serial ATA (Vendor Specific Interface)" }, + { 0x010601, 0, "Serial ATA", "Serial ATA (AHCI 1.0)" }, + { 0x010700, 0, "SCSI", "Serial Attached SCSI (SAS)" }, + { 0x018000, 0, "Storage Controller", "Other Mass Storage Controller" }, + { 0x020000, 0, "Ethernet Controller", "Ethernet Controller" }, + { 0x020100, 0, "Token Ring Controller", "Token Ring Controller" }, + { 0x020200, 0, "FDDI Controller", "FDDI Controller" }, + { 0x020300, 0, "ATM Controller", "ATM Controller" }, + { 0x020400, 0, "ISDN Controller", "ISDN Controller" }, + { 0x020500, 0, "WorldFip Controller", "WorldFip Controller" }, + { 0x0206, 1, "PICMG 2.14", "PICMG 2.14 Multi Computing" }, + { 0x028000, 0, "Network Controller", "Other Network Controller" }, + { 0x030000, 0, "VGA-Compatible Controller", "VGA-Compatible Controller" }, + { 0x030001, 0, "8512-Compatible Controller", "8512-Compatible Controller" }, + { 0x030100, 0, "XGA Controller", "XGA Controller" }, + { 0x030200, 0, "3D Controller (Not VGA-Compatible)", "3D Controller (Not VGA-Compatible)" }, + { 0x038000, 0, "Display Controller", "Other Display Controller" }, + { 0x040000, 0, "Video Device", "Video Device" }, + { 0x040100, 0, "Audio Device", "Audio Device" }, + { 0x040200, 0, "Computer Telephony Device", "Computer Telephony Device" }, + { 0x048000, 0, "Other Multimedia Device", "Other Multimedia Device" }, + { 0x050000, 0, "RAM Controller", "RAM Controller" }, + { 0x050100, 0, "Flash Controller", "Flash Controller" }, + { 0x058000, 0, "Memory Controller", "Other Memory Controller" }, + { 0x060000, 0, "Host Bridge", "Host Bridge" }, + { 0x060100, 0, "ISA Bridge", "ISA Bridge" }, + { 0x060200, 0, "EISA Bridge", "EISA Bridge" }, + { 0x060300, 0, "MCA Bridge", "MCA Bridge" }, + { 0x060400, 0, "PCI-to-PCI Bridge", "PCI-to-PCI Bridge" }, + { 0x060401, 0, "PCI-to-PCI Bridge", "PCI-to-PCI Bridge (Subtractive Decode)" }, + { 0x060500, 0, "PCMCIA Bridge", "PCMCIA Bridge" }, + { 0x060600, 0, "NuBus Bridge", "NuBus Bridge" }, + { 0x060700, 0, "CardBus Bridge", "CardBus Bridge" }, + { 0x0608, 1, "RACEway Bridge", "RACEway Bridge" }, + { 0x060940, 0, "PCI-to-PCI Bridge", "PCI-to-PCI Bridge (Semi-Transparent, Primary)" }, + { 0x060980, 0, "PCI-to-PCI Bridge", "PCI-to-PCI Bridge (Semi-Transparent, Secondary)" }, + { 0x060A00, 0, "InfiniBrand-to-PCI Host Bridge", "InfiniBrand-to-PCI Host Bridge" }, + { 0x068000, 0, "Bridge Device", "Other Bridge Device" }, + { 0x070000, 0, "Serial Controller", "Generic XT-Compatible Serial Controller" }, + { 0x070001, 0, "Serial Controller", "16450-Compatible Serial Controller" }, + { 0x070002, 0, "Serial Controller", "16550-Compatible Serial Controller" }, + { 0x070003, 0, "Serial Controller", "16650-Compatible Serial Controller" }, + { 0x070004, 0, "Serial Controller", "16750-Compatible Serial Controller" }, + { 0x070005, 0, "Serial Controller", "16850-Compatible Serial Controller" }, + { 0x070006, 0, "Serial Controller", "16950-Compatible Serial Controller" }, + { 0x070100, 0, "Parallel Port", "Parallel Port" }, + { 0x070101, 0, "Parallel Port", "Bi-Directional Parallel Port" }, + { 0x070102, 0, "X Parallel Port", "ECP 1.X Compliant Parallel Port" }, + { 0x070103, 0, "IEEE 1284 Controller", "IEEE 1284 Controller" }, + { 0x0701FE, 0, "IEEE 1284 Target Device", "IEEE 1284 Target Device" }, + { 0x070200, 0, "Serial Controller", "Multiport Serial Controller" }, + { 0x070300, 0, "Generic Modem", "Generic Modem" }, + { 0x070301, 0, "Hayes Compatible Modem", "Hayes Compatible Modem (16450-Compatible Interface)" }, + { 0x070302, 0, "Hayes Compatible Modem", "Hayes Compatible Modem (16550-Compatible Interface)" }, + { 0x070303, 0, "Hayes Compatible Modem", "Hayes Compatible Modem (16650-Compatible Interface)" }, + { 0x070304, 0, "Hayes Compatible Modem", "Hayes Compatible Modem (16750-Compatible Interface)" }, + { 0x070400, 0, "IEEE 488.1/2 Controller", "IEEE 488.1/2 (GPIB) Controller" }, + { 0x070500, 0, "Smart Card", "Smart Card" }, + { 0x078000, 0, "Communications Device", "Other Communications Device" }, + { 0x080000, 0, "Generic 8259 PIC", "Generic 8259 PIC" }, + { 0x080001, 0, "ISA PIC", "ISA PIC" }, + { 0x080002, 0, "EISA PIC", "EISA PIC" }, + { 0x080010, 0, "APIC Interrupt Controller", "I/O APIC Interrupt Controller" }, + { 0x080020, 0, "APIC Interrupt Controller", "I/O(x) APIC Interrupt Controller" }, + { 0x080100, 0, "8237 DMA Controller", "Generic 8237 DMA Controller" }, + { 0x080101, 0, "ISA DMA Controller", "ISA DMA Controller" }, + { 0x080102, 0, "EISA DMA Controller", "EISA DMA Controller" }, + { 0x080200, 0, "8254 System Timer", "Generic 8254 System Timer" }, + { 0x080201, 0, "ISA System Timer", "ISA System Timer" }, + { 0x080202, 0, "EISA System Timer", "EISA System Timer" }, + { 0x080300, 0, "Generic RTC Controller", "Generic RTC Controller" }, + { 0x080301, 0, "ISA RTC Controller", "ISA RTC Controller" }, + { 0x080400, 0, "Generic PCI Hot-Plug Controller", "Generic PCI Hot-Plug Controller" }, + { 0x088000, 0, "Other System Peripheral", "Other System Peripheral" }, + { 0x090000, 0, "Keyboard Controller", "Keyboard Controller" }, + { 0x090100, 0, "Digitizer", "Digitizer" }, + { 0x090200, 0, "Mouse Controller", "Mouse Controller" }, + { 0x090300, 0, "Scanner Controller", "Scanner Controller" }, + { 0x090400, 0, "Gameport Controller (Generic)", "Gameport Controller (Generic)" }, + { 0x090410, 0, "Gameport Contrlller (Legacy)", "Gameport Contrlller (Legacy)" }, + { 0x098000, 0, "Other Input Controller", "Other Input Controller" }, + { 0x0A0000, 0, "Generic Docking Station", "Generic Docking Station" }, + { 0x0A8000, 0, "Other Docking Station", "Other Docking Station" }, + { 0x0B0000, 0, "386 Processor", "386 Processor" }, + { 0x0B0100, 0, "486 Processor", "486 Processor" }, + { 0x0B0200, 0, "Pentium Processor", "Pentium Processor" }, + { 0x0B1000, 0, "Alpha Processor", "Alpha Processor" }, + { 0x0B2000, 0, "PowerPC Processor", "PowerPC Processor" }, + { 0x0B3000, 0, "MIPS Processor", "MIPS Processor" }, + { 0x0B4000, 0, "Co-Processor", "Co-Processor" }, + { 0x0C0000, 0, "IEEE 1394 Controller", "IEEE 1394 Controller (FireWire)" }, + { 0x0C0010, 0, "IEEE 1394 Controller", "IEEE 1394 Controller (1394 OpenHCI Spec)" }, + { 0x0C0100, 0, "ACCESS.bus", "ACCESS.bus" }, + { 0x0C0200, 0, "SSA", "SSA" }, + { 0x0C0300, 0, "USB", "USB (Universal Host Controller Spec)" }, + { 0x0C0310, 0, "USB", "USB (Open Host Controller Spec" }, + { 0x0C0320, 0, "USB2 Host Controller", "USB2 Host Controller (Intel Enhanced Host Controller Interface)" }, + { 0x0C0380, 0, "USB", "USB" }, + { 0x0C03FE, 0, "USB", "USB (Not Host Controller)" }, + { 0x0C0400, 0, "Fibre Channel", "Fibre Channel" }, + { 0x0C0500, 0, "SMBus", "SMBus" }, + { 0x0C0600, 0, "InfiniBand", "InfiniBand" }, + { 0x0C0700, 0, "IPMI SMIC Interface", "IPMI SMIC Interface" }, + { 0x0C0701, 0, "IPMI Kybd Interface", "IPMI Kybd Controller Style Interface" }, + { 0x0C0702, 0, "IPMI Block Interface", "IPMI Block Transfer Interface" }, + { 0x0C0800, 0, "SERCOS Interface", "SERCOS Interface Standard (IEC 61491)" }, + { 0x0C0900, 0, "CANbus", "CANbus" }, + { 0x0D0000, 0, "iRDA Controller", "iRDA Compatible Controller" }, + { 0x0D0100, 0, "IR Controller", "Consumer IR Controller" }, + { 0x0D1000, 0, "RF Controller", "RF Controller" }, + { 0x0D1100, 0, "Bluetooth Controller", "Bluetooth Controller" }, + { 0x0D1200, 0, "Broadband Controller", "Broadband Controller" }, + { 0x0D2000, 0, "Ethernet Controller (802.11a)", "Ethernet Controller (802.11a)" }, + { 0x0D2100, 0, "Ethernet Controller (802.11b)", "Ethernet Controller (802.11b)" }, + { 0x0D8000, 0, "Wireless Controller", "Other Wireless Controller" }, + { 0x0E00, 1, "I20 Architecture", "I20 Architecture" }, + { 0x0E0000, 0, "Message FIFO", "Message FIFO" }, + { 0x0F0100, 0, "TV Controller", "TV Controller" }, + { 0x0F0200, 0, "Audio Controller", "Audio Controller" }, + { 0x0F0300, 0, "Voice Controller", "Voice Controller" }, + { 0x0F0400, 0, "Data Controller", "Data Controller" }, + { 0x100000, 0, "Computing Encrpytion/Decryption", "Network and Computing Encrpytion/Decryption" }, + { 0x101000, 0, "Entertainment Encryption/Decryption", "Entertainment Encryption/Decryption" }, + { 0x108000, 0, "Other Encryption/Decryption", "Other Encryption/Decryption" }, + { 0x110000, 0, "DPIO Modules", "DPIO Modules" }, + { 0x110100, 0, "Performance Counters", "Performance Counters" }, + { 0x111000, 0, "Communications Syncrhonization Plus Time and Frequency Test/Measurment", "Communications Syncrhonization Plus Time and Frequency Test/Measurment" }, + { 0x112000, 0, "Management Card", "Management Card" }, + { 0x118000, 0, "Acquisition/Signal Processing Controller", "Other Data Acquisition/Signal Processing Controller" }, { 0x000000, 0, 0 } }; diff --git a/kernel/setup.c b/kernel/setup.c index f932631..d7bbf11 100644 --- a/kernel/setup.c +++ b/kernel/setup.c @@ -50,9 +50,9 @@ void setup_i8253() const char *version = "Kernel version " VERSION - " ["__DATE__ " " __TIME__ "]" " @ " BUIDER + " ["__DATE__ " " __TIME__ "]" "\n"; void setup_kernel() @@ -74,6 +74,7 @@ void setup_kernel() set_tss(); + setup_sysc(); cnsl_init(); @@ -87,15 +88,18 @@ void setup_kernel() //switch_printk_screen(); setup_pci(); //switch_printk_screen(); + system_delay(); void ide_init(); ide_init(); + system_delay(); + detect_cpu(); setup_fs(); - vga_puts(0, version, 0x2F); + //vga_puts(0, version, 0x2F); + printk(version); switch_printk_screen(); } - diff --git a/kernel/system.c b/kernel/system.c index 26a9390..7035db0 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -174,4 +174,16 @@ int sysc_reboot(int mode) return 0; } - +void system_delay() +{ + unsigned long flags; + irq_save(flags); + unsigned int n = system.delay; + while(n--) + { + unsigned long cr0; + asm("movl %%cr0, %%eax;":"=a"(cr0)); + asm("movl %%eax, %%cr0;"::"a"(cr0)); + } + irq_restore(flags); +} diff --git a/mm/buddy.c b/mm/buddy.c index 0b8e767..092f2ae 100644 --- a/mm/buddy.c +++ b/mm/buddy.c @@ -261,5 +261,5 @@ void init_buddy_system() // free bootmem bitmap pages to buddy system // ... - dump_buddy_system(); + //dump_buddy_system(); } diff --git a/mm/mm.c b/mm/mm.c index 8c50ba1..26e6d56 100644 --- a/mm/mm.c +++ b/mm/mm.c @@ -61,7 +61,7 @@ void e820_print_map() { struct e820_entry *p = boot_params.e820map.map + i; - printk("[%02d] 0x%08x - 0x%08x size %- 10d %8dKB %5dMB ", i, p->addr, p->addr + p->size, p->size, p->size>>10, p->size>>20); + printk("[%02d] 0x%08x - 0x%08x size %- 10d %8dKB %5dMB ", i, p->addr, p->addr + p->size - 1, p->size, p->size>>10, p->size>>20); e820_print_type(p->type); @@ -308,8 +308,6 @@ extern void sysexit(); void init_paging() { - printk("max_pfn %u", bootmem_data.max_pfn); - //while(1); unsigned int i; unsigned long pfn = 0; pte_t *pte = 0; @@ -353,8 +351,10 @@ void init_mm() init_bootmem(); printk("init global paging...\n"); init_paging(); + printk("init buddy system...\n"); init_buddy_system(); + printk("init slub system...\n"); init_slub_system(); printk("memory init finished...\n"); diff --git a/mm/page.c b/mm/page.c index 0f6f877..b228a32 100644 --- a/mm/page.c +++ b/mm/page.c @@ -19,7 +19,6 @@ void do_no_page(void *addr) { - //printk("%s addr %08x current %08x", __func__, (unsigned long)addr, current); pde_t *page_dir = (pde_t *)current->cr3; pte_t *page_tbl = 0; @@ -60,13 +59,9 @@ void do_wp_page(void *addr) pde_t *page_dir = (pde_t *)current->cr3; pte_t *page_tbl = pa2va(PAGE_ALIGN(page_dir[npde])); - //printk("%s addr %08x dirent %08x\n", __func__, (unsigned long)addr, page_dir[npde]); - //assert(page_dir[npde] != 0); - unsigned long wp_pa_addr = PAGE_ALIGN(page_tbl[npte]); page_t *page = pa2page(wp_pa_addr); - //printk("page count %u\n", page->count); if(page->count > 0) { page->count --; diff --git a/mm/slub.c b/mm/slub.c index 560f290..820ce8e 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -320,7 +320,7 @@ void init_slub_system() kmem_cache_init(cache, "kmalloc_old", 1UL<list), &slub_caches); - printk("kmem objsize %d\tsize %d \n", cache->objsize, cache->size); + //printk("kmem objsize %d\tsize %d \n", cache->objsize, cache->size); } #if 0 diff --git a/scripts/grub.cfg b/scripts/grub.cfg index 536311e..26f771f 100644 --- a/scripts/grub.cfg +++ b/scripts/grub.cfg @@ -8,5 +8,5 @@ insmod ext2 root=(hd0,msdos1) menuentry 'Kernel' --class os { - multiboot /boot/Kernel root=hda0 + multiboot /boot/Kernel root=hda0 delay=20000000 } -- 2.44.0