Changeset 521 for Whitix/branches/hybrid

Show
Ignore:
Timestamp:
05/24/08 09:48:31 (3 months ago)
Author:
mwhitworth
Message:

Update build process.

Location:
Whitix/branches/hybrid/devices
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/hybrid/devices/Makefile

    r235 r521  
    22include ../make.inc 
    33 
    4 OBJS = misc.o 
     4MODULES = misc.sys 
    55 
    6 build: $(OBJS) 
     6build: $(MODULES) 
    77        make -C input 
    88        make -C net 
     
    1010        make -C storage 
    1111 
     12modules_install: 
     13        cp *.sys ../CdRoot/System/Modules/Core 
     14        make -C input modules_install 
     15        make -C net modules_install 
     16        make -C pci modules_install 
     17        make -C storage modules_install 
     18 
    1219clean: 
    13         rm *.o -f 
     20        rm *.sys -f 
    1421        make -C net clean 
    1522        make -C storage clean 
  • Whitix/branches/hybrid/devices/net/ne2k-pci.c

    r246 r521  
    3030{ 
    3131//      struct NetDevice* netDev=(struct NetDevice*)data; 
    32         printf("Ne2kIrq\n"); 
     32        KePrint("Ne2kIrq\n"); 
    3333 
    3434        return 0; 
     
    3737int Ne2kSend(struct NetDevice* device, struct SocketBuffer* sockBuff) 
    3838{ 
    39         printf("Ne2kSend\n"); 
     39        KePrint("Ne2kSend\n"); 
    4040        return 0; 
    4141} 
     
    7373        if (ret) 
    7474        { 
    75                 printf("NE2K: Could not enable device.\n"); 
     75                KePrint("NE2K: Could not enable device.\n"); 
    7676                return -EIO; 
    7777        } 
     
    8686        if (!netDev) 
    8787        { 
    88                 printf("NE2K: Could not allocate network device.\n"); 
     88                KePrint("NE2K: Could not allocate network device.\n"); 
    8989                return -EIO; 
    9090        } 
     
    9999        if (ret) 
    100100        { 
    101                 printf("NE2K: Could not enable device irq.\n"); 
     101                KePrint("NE2K: Could not enable device irq.\n"); 
    102102                return -EIO; 
    103103        } 
    104104 
    105         printf("NE2K: Found device. I/O base = %#X, irq = %u\n", ioAddr, device->irq); 
     105        KePrint("NE2K: Found device. I/O base = %#X, irq = %u\n", ioAddr, device->irq); 
    106106 
    107107        /* Get the station (MAC) address. */ 
  • Whitix/branches/hybrid/devices/storage/Makefile

    r1 r521  
    22include ../../make.inc 
    33 
    4 OBJS = floppy.o ramdisk.o sdevice.o 
     4MODULES = floppy.sys ramdisk.sys 
    55 
    6 build: $(OBJS) 
     6build: $(MODULES) 
    77        make -C ata 
     8 
     9modules_install: 
     10        make -C ata modules_install 
     11        cp *.sys ../../CdRoot/System/Modules/Storage 
    812 
    913clean: 
    1014        make -C ata clean 
    11         rm *.o -f 
     15        rm *.o *.sys -f 
  • Whitix/branches/hybrid/devices/storage/ata/Makefile

    r1 r521  
    22include ../../../make.inc 
    33 
    4 OBJS = ata.o ata-disk.o ata-cd.o ata-identify.o 
     4MODULES = ata.sys ata-disk.sys ata-cd.sys ata-identify.sys 
    55 
    6 build: $(OBJS) 
     6build: $(MODULES) 
     7        ld -r $(MODULES) -o ata_ide.sys 
     8 
     9modules_install: 
     10        cp ata_ide.sys ../../../CdRoot/System/Modules/Storage/ 
    711 
    812clean: 
    9         rm *.o -f 
     13        rm *.o *.sys -f 
  • Whitix/branches/hybrid/devices/storage/ata/ata-cd.c

    r235 r521  
    143143        if (request->retries > 5) 
    144144        { 
    145                 printf("ATA-CD: failed to read, error = %#X, count = %u, status = %d\n",inb(CTRL_REG(drive->parent,REG_ERROR)), 
     145                KePrint("ATA-CD: failed to read, error = %#X, count = %u, status = %d\n",inb(CTRL_REG(drive->parent,REG_ERROR)), 
    146146                        AtapiTransferCount(drive->parent),status); 
    147147                StorageEndRequest(drive->sDev,EIO); 
     
    187187        { 
    188188        case ATAPI_PHASE_ABORT: 
    189                 printf("Drive aborted the command.\n"); 
     189                KePrint("Drive aborted the command.\n"); 
    190190                AtapiError(drive,request,status); 
    191191                break; 
     
    212212 
    213213        default: 
    214                 printf("Bad phase, %d\n",phase); 
     214                KePrint("Bad phase, %d\n",phase); 
    215215        }; 
    216216 
  • Whitix/branches/hybrid/devices/storage/ata/ata-disk.c

    r68 r521  
    3232        if (!request) 
    3333        { 
    34                 printf("AtaRwInterrupt: request is null?\n"); 
     34                KePrint("AtaRwInterrupt: request is null?\n"); 
    3535                return; 
    3636        } 
     
    3838        if (status & STATE_ERR || status & STATE_DF) 
    3939        { 
    40                 printf("AtaRwInterrupt: failure reading sector %u\n",request->sector); 
     40                KePrint("AtaRwInterrupt: failure reading sector %u\n",request->sector); 
    4141                /* Failure? If so, do it again */ 
    4242                drive->busy=0; 
     
    4949                if (AtaWaitForState(drive->parent,STATE_BUSY | STATE_DRQ,STATE_DRQ)) 
    5050                { 
    51                         printf("Timed out waiting for read\n"); 
     51                        KePrint("Timed out waiting for read\n"); 
    5252                        drive->busy=0; 
    5353                        AtaRequest(drive); 
  • Whitix/branches/hybrid/devices/storage/ata/ata-identify.c

    r68 r521  
    116116        int ret=0; 
    117117 
    118         Sleep(50); 
     118//      Sleep(50); 
    119119 
    120120        if (cmd == CMD_ATA_PIDENTIFY) 
     
    124124 
    125125        timeout=((cmd == CMD_ATA_IDENTIFY) ? 3000 : 1000)/2; 
    126         startTime=time; 
     126        startTime=PitGetQuantums(); 
    127127 
    128128        SaveFlags(flags); 
     
    131131        do 
    132132        { 
    133                 if ((time-startTime) > timeout) 
     133                if ((PitGetQuantums()-startTime) > timeout) 
    134134                { 
    135135                        IrqRestoreFlags(flags); 
    136                         printf("Identify timed out: reg = %#X\n",(DWORD)reg); 
     136                        KePrint("Identify timed out: reg = %#X\n",(DWORD)reg); 
    137137                        return 2; 
    138138                } 
    139139 
    140                 Sleep(50); /* Don't keep pestering the drive */ 
     140//              Sleep(50); /* Don't keep pestering the drive */ 
    141141 
    142142                reg=inb(CTRL_REG(drive->parent,REG_CONTROL)); 
    143143        }while (reg & STATE_BUSY); 
    144144 
    145         Sleep(50); 
     145//      Sleep(50); 
    146146 
    147147        if ((inb(CTRL_REG(drive->parent,REG_STATUS)) & (STATE_DRQ | STATE_BUSY | STATE_ERR)) == STATE_DRQ) 
     
    185185                return -ENOMEM; 
    186186 
    187         Sleep(50); 
     187//      Sleep(50); 
    188188        AtaSelectDrive(drive); 
    189         Sleep(50); 
     189//      Sleep(50); 
    190190 
    191191        reg=inb(CTRL_REG(drive->parent,REG_SELECT)); 
     
    195195                /* Select drive 0 and exit */ 
    196196                outb(CTRL_REG(drive->parent,REG_STATUS),LDH_DEFAULT); 
    197                 Sleep(50); 
     197//              Sleep(50); 
    198198                return 2; 
    199199        } 
     
    218218        else if (ret == 2 && cmd == CMD_ATA_PIDENTIFY) 
    219219        { 
    220                 printf("No response (%#02X) - resetting drive interface\n",inb(CTRL_REG(drive->parent,REG_COMMAND))); 
    221                 Sleep(50); 
     220                KePrint("No response (%#02X) - resetting drive interface\n",inb(CTRL_REG(drive->parent,REG_COMMAND))); 
     221//              Sleep(50); 
    222222                AtaSelectDrive(drive); 
    223                 Sleep(50); 
     223//              Sleep(50); 
    224224                outb(CTRL_REG(drive->parent,REG_COMMAND),ATAPI_CMD_SRST); 
    225225 
    226                 startTime=time; 
     226                startTime=PitGetQuantums(); 
    227227 
    228228                IrqSaveFlags(flags); 
     
    230230 
    231231                do 
    232                         Sleep(50); 
    233                 while ((inb(CTRL_REG(drive->parent,REG_COMMAND)) & STATE_BUSY) && (time-startTime) > 3000); 
     232//                      Sleep(50); 
     233                        asm("nop"); 
     234                while ((inb(CTRL_REG(drive->parent,REG_COMMAND)) & STATE_BUSY) && (PitGetQuantums()-startTime) > 3000); 
    234235 
    235236                ret=AtaDoIdentify(drive,cmd); 
     
    278279                        return -EIO; 
    279280                 
    280                 printf("CD/DVD drive\n"); 
     281                KePrint("CD/DVD drive\n"); 
    281282        }else 
    282                 printf("Hard Drive\n"); 
     283                KePrint("Hard Drive\n"); 
    283284 
    284285        /* Exit with drive 0 selected */ 
    285286        outb(CTRL_REG(drive->parent,REG_SELECT),LDH_DEFAULT); 
    286         Sleep(50); 
     287//      Sleep(50); 
    287288        inb(CTRL_REG(drive->parent,REG_STATUS)); 
    288289 
  • Whitix/branches/hybrid/devices/storage/ata/ata.c

    r254 r521  
    7474        sti(); 
    7575 
    76         for (startTime=time; time-startTime<100;) 
     76        for (startTime=PitGetQuantums(); PitGetQuantums()-startTime<100;) 
    7777        { 
    7878                status=inb(CTRL_REG(controller,REG_CONTROL)); 
     
    199199        while (timeOut--) 
    200200        { 
    201                 Sleep(10); 
    202201                reg=inb(CTRL_REG(controller,REG_STATUS)); 
    203202                if (!(reg & STATE_BUSY)) 
     
    232231 
    233232        /* Needs a small delay loop */ 
    234         Sleep(1); 
     233//      Sleep(1); 
    235234 
    236235        outb(CTRL_REG(controller,REG_CONTROL),CTL_EIGHTHEADS); 
    237236 
    238         Sleep(10); 
     237//      Sleep(10); 
    239238 
    240239        /* Wait at most 35 (!) seconds for it to unbusy itself */ 
     
    247246 
    248247        outb(CTRL_REG(controller,REG_CONTROL),CTL_EIGHTHEADS); 
    249         Sleep(1); 
     248//      Sleep(1); 
    250249        AtaWaitNotBusy(controller,1000); 
    251250 
    252251        outb(CTRL_REG(controller,REG_SELECT),LDH_DEFAULT | 1 << 4); 
    253252        outb(CTRL_REG(controller,REG_CONTROL),CTL_EIGHTHEADS); 
    254         Sleep(1); 
     253//      Sleep(1); 
    255254        AtaWaitNotBusy(controller,1000); 
    256255 
     
    356355        StorageQueueInit(sDevice); 
    357356 
    358         printf("Partition found: %#X, %u, %u\n",(DWORD)part[i].system,part[i].startSectorAbs,part[i].sectorCount); 
     357        KePrint("Partition found: %#X, %u, %u\n",(DWORD)part[i].system,part[i].startSectorAbs,part[i].sectorCount); 
    359358 
    360359        return 0; 
  • Whitix/branches/hybrid/devices/storage/floppy.c

    r159 r521  
    209209        if (fdc->sr0 & 0x10) 
    210210        { 
    211                 printf("Recal failed, trying again\n"); 
     211                KePrint("Recal failed, trying again\n"); 
    212212                FdcRecal(fdc); 
    213213                return; 
     
    226226        if (!(fdc->handler)) 
    227227        { 
    228                 printf("floppy: No handler for interrupt, %#X\n",fdc->busy); 
     228                KePrint("floppy: No handler for interrupt, %#X\n",fdc->busy); 
    229229                return 0; 
    230230        } 
     
    243243        if (UNLIKELY(err)) 
    244244        { 
    245                 printf("Floppy: I/O error, starting again\n"); 
    246  
    247                 printf("Floppy registers: \n"); 
     245                KePrint("Floppy: I/O error, starting again\n"); 
     246 
     247                KePrint("Floppy registers: \n"); 
    248248                int i; 
    249249                for (i=0; i<num; i++) 
    250                         printf("%d: %#X\n",i,(DWORD)fdc->status[i]); 
    251  
    252                 printf("err = %d,num = %d\n",err,num); 
     250                        KePrint("%d: %#X\n",i,(DWORD)fdc->status[i]); 
     251 
     252                KePrint("err = %d,num = %d\n",err,num); 
    253253 
    254254                currRequest->retries++; 
     
    266266                        { 
    267267                                /* Write protected */ 
    268                                 printf("Floppy is write-protected\n"); 
     268                                KePrint("Floppy is write-protected\n"); 
    269269                        }else if (fdc->status[1] & 0x4) 
    270270                        { 
    271                                 printf("No data. Unreadable\n"); 
    272                                 printf("Floppy thinks chs is %d,%d,%d\n",fdc->status[3],fdc->status[4],fdc->status[5]); 
     271                                KePrint("No data. Unreadable\n"); 
     272                                KePrint("Floppy thinks chs is %d,%d,%d\n",fdc->status[3],fdc->status[4],fdc->status[5]); 
    273273                        } 
    274274                } 
     
    338338        if ((fdc->sr0 & 0xF8) != SEEK_SUCCESS ||  fdc->currTrack != fdc->rwTrack) 
    339339        { 
    340                 printf("Floppy seek failed\n"); 
     340                KePrint("Floppy seek failed\n"); 
    341341 
    342342                /* If a seek is not possible, a disk may not even be in the drive */ 
     
    474474        IrqSaveFlags(flags); 
    475475 
    476         printf("Resetting floppy\n"); 
     476        KePrint("Resetting floppy\n"); 
    477477 
    478478        fdc->handler=FdcResetInterrupt; 
  • Whitix/branches/hybrid/devices/storage/ramdisk.c

    r61 r521  
    9898        } 
    9999 
    100         printf("%d ramdisks loaded, of size %d\n",MAX_RAMDISKS,RAMDISK_SIZE); 
     100        KePrint("%d ramdisks loaded, of size %d\n",MAX_RAMDISKS,RAMDISK_SIZE); 
    101101 
    102102        return 0;