diff --git a/src/sys/include/pci/lnc.h b/src/sys/include/pci/lnc.h index 9f0cef2..c68e0dd 100644 --- a/src/sys/include/pci/lnc.h +++ b/src/sys/include/pci/lnc.h @@ -173,7 +173,7 @@ void writeBcr(struct lncInfo *lnc, uInt16 port, uInt16 val); uInt16 readBcr(struct lncInfo *lnc, uInt16 port); -void initLNC(); +int initLNC(); int probe(struct lncInfo *lnc); int lanceProbe(struct lncInfo *lnc); int lncAttach(struct lncInfo *lnc,int unit); diff --git a/src/sys/init/main.c b/src/sys/init/main.c index b5dfbde..bdecda4 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -109,7 +109,7 @@ /* Modify src/sys/include/ubixos/init.h to add a startup routine */ for (i = 0x0; i < init_tasksTotal; i++) { if (init_tasks[i]() != 0x0) - kpanic("Error: Initializing System.\n"); + kpanic("Error: Initializing System Task[%i].\n", i); } /* New Root Mount Point */ diff --git a/src/sys/net/net/init.c b/src/sys/net/net/init.c index e6d77fb..f62c9cd 100644 --- a/src/sys/net/net/init.c +++ b/src/sys/net/net/init.c @@ -75,8 +75,8 @@ kprintf("TCP/IP initialized.\n"); - IP4_ADDR(&gw, 10,50,0,7); - IP4_ADDR(&ipaddr, 10,50,0,1); + IP4_ADDR(&gw, 10,50,0,1); + IP4_ADDR(&ipaddr, 10,50,0,7); IP4_ADDR(&netmask, 255,255,0,0); netif_set_default(netif_add(&ipaddr, &netmask, &gw, ethernetif_init, tcpip_input)); diff --git a/src/sys/pci/lnc.c b/src/sys/pci/lnc.c index bde2327..5d638bc 100644 --- a/src/sys/pci/lnc.c +++ b/src/sys/pci/lnc.c @@ -101,24 +101,21 @@ } -void initLNC() { +int initLNC() { int i = 0x0; lnc = kmalloc(sizeof(struct lncInfo)); - lnc->rap = 0xE2000000 + PCNET_RAP; - lnc->rdp = 0xE2000000 + PCNET_RDP; - lnc->bdp = 0xE2000000 + PCNET_BDP; + lnc->rap = 0xD000 + PCNET_RAP; + lnc->rdp = 0xD000 + PCNET_RDP; + lnc->bdp = 0xD000 + PCNET_BDP; - kprintf("[0x%X]", inportDWord(0xE2000000 + 0x18)); - kprintf("[0x%X]", inportWord(0xE2000000 + 0x14)); + inportDWord(0xD000 + 0x18); + inportWord(0xD000 + 0x14); - outportDWord(0xE2000000 + 0x10, 0); - for (i = 0; i < 4;i++) - kprintf("[0x%X]", inportDWord(0xE2000000 + (0x4 * i))); + //outportDWord(0xD000 + 0x10, 0); - kprintf("[0x%X]", inportDWord(0xE2000000 + 0x00)); lnc->nic.ic = probe(lnc); -kprintf("[0x%X]\n", lnc->nic.ic); + if ((lnc->nic.ic > 0) && (lnc->nic.ic >= PCnet_32)) { lnc->nic.ident = NE2100; lnc->nic.memMode = DMA_FIXED; @@ -128,13 +125,13 @@ /* Extract MAC address from PROM */ for (i = 0; i < ETHER_ADDR_LEN; i++) { - lnc->arpcom.ac_enaddr[i] = inportByte(0xE2000000 + i); + lnc->arpcom.ac_enaddr[i] = inportByte(0xD000 + i); kprintf("[0x%X]",lnc->arpcom.ac_enaddr[i]); } } else { kprintf("LNC Init Error\n"); - return; + return(-1); } lncAttach(lnc,0); writeCsr(lnc, CSR3, 0); @@ -155,9 +152,9 @@ } else { kprintf("LNC init Error\n"); - return; + return(-1); } - return; + return(0); } int probe(struct lncInfo *lnc) { @@ -166,7 +163,6 @@ if ((type = lanceProbe(lnc))) { chipId = readCsr(lnc, CSR89); -kprintf("chipId: %i", chipId); chipId <<= 16; chipId |= readCsr(lnc, CSR88); if (chipId & AMD_MASK) { @@ -203,7 +199,7 @@ uInt16 inW = 0; writeCsr(lnc, CSR0, STOP); inW = inportWord(lnc->rdp); - kprintf("[inW: 0x%X - 0x%X - 0x%X - (0x%X)]",inW, STOP, inW & STOP, readCsr(lnc, CSR3)); + //MrOlsen (2017-12-16) - kprintf("[inW: {0x%X} 0x%X - 0x%X - 0x%X - (0x%X)]", lnc->rdp,inW, STOP, inW & STOP, readCsr(lnc, CSR3)); if ((inW & STOP) && !(readCsr(lnc, CSR3))) { writeCsr(lnc, CSR0, INEA); if (readCsr(lnc, CSR0) & INEA) { diff --git a/src/sys/pci/pci.c b/src/sys/pci/pci.c index a96ca05..f6f5621 100644 --- a/src/sys/pci/pci.c +++ b/src/sys/pci/pci.c @@ -254,11 +254,11 @@ cfg->func = func; cfg->subsysVendor = pciRead(bus, dev, func, 0x2c, 2); cfg->subsys = pciRead(bus, dev, func, 0x2e, 2); -if (cfg->vendorId == 0x1022) { +//if (cfg->vendorId == 0x1022) { kprintf("Device Info: /bus/pci/%d/%d/%d\n",bus,dev,func); kprintf(" * Vendor: %X Device: %X Class/SubClass/Interface %X/%X/%X\n",cfg->vendorId,cfg->deviceId,cfg->baseClass,cfg->subClass,cfg->interface); kprintf(" * Status: %X Command: %X BIST/Type/Lat/CLS: %X/%X/%X/%X\n",cfg->status, cfg->command, cfg->bist, cfg->headerType,cfg->latencyTimer, cfg->cacheLineSize); -} +//} switch(cfg->headerType & 0x7F){ case 0: /* normal device */ for(i=0;i<6;i++) { @@ -308,7 +308,8 @@ /* kprintf(" * Vendor: %X Device: %X Class/SubClass/Interface %X/%X/%X\n",pcfg.vendorId,pcfg.deviceId,pcfg.baseClass,pcfg.subClass,pcfg.interface); */ for (i=0x0;i