Changeset eff1a590 in mainline


Ignore:
Timestamp:
2010-03-25T14:47:20Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1769ee
Parents:
a087f2e
Message:

parts of code of a dummy root HW device driver for ia32 platform

Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/amd64/Makefile.inc

    ra087f2e reff1a590  
    3737
    3838RD_DRVS = \
    39         root
     39        root \
     40        rootia32
    4041
    4142MODULES := $(notdir $(COMPONENTS))
  • uspace/Makefile

    ra087f2e reff1a590  
    7676
    7777ifeq ($(UARCH),ia32)
    78         DIRS += srv/dd
     78        DIRS += srv/dd
     79        DIRS += srv/drivers/rootia32
    7980#       DIRS += srv/hw/bus/pci
    8081endif
  • uspace/lib/libdrv/include/driver.h

    ra087f2e reff1a590  
    4444        const char *name;
    4545        match_id_list_t match_ids;
     46        void *driver_data;
    4647       
    47         // TODO add more items - parent bus type etc.
     48        // TODO add more items
    4849       
    4950        link_t link;
     
    7273}
    7374
    74 static inline delete_device(device_t *dev) {
     75static inline void delete_device(device_t *dev) {
    7576        clean_match_ids(&dev->match_ids);
    7677        if (NULL != dev->name) {
  • uspace/srv/devman/devman.c

    ra087f2e reff1a590  
    591591        size_t pathsize = (str_size(node->name) + 1);   
    592592        if (NULL != parent) {           
    593                 pathsize += str_size(parent->name) + 1;         
     593                pathsize += str_size(parent->pathname) + 1;             
    594594        }
    595595       
  • uspace/srv/drivers/root/root.c

    ra087f2e reff1a590  
    8080        if (NULL == (platform = create_device())) {
    8181                goto failure;
    82         }
     82        }       
    8383       
    84         // TODO - replace this with some better solution (sysinfo ?)
    85         platform->name = STRING(UARCH);
     84        platform->name = "hw";
    8685        printf(NAME ": the new device's name is %s.\n", platform->name);
    8786       
     
    9089                goto failure;
    9190        }
    92         match_id->id = platform->name;
     91       
     92        // TODO - replace this with some better solution (sysinfo ?)
     93        match_id->id = STRING(UARCH);
    9394        match_id->score = 100;
    9495        add_match_id(&platform->match_ids, match_id);   
     
    130131}
    131132
    132 static bool root_init()
    133 {
    134         // TODO  driver initialization 
    135         return true;
    136 }
    137 
    138133int main(int argc, char *argv[])
    139134{
    140         printf(NAME ": HelenOS root device driver\n");
    141         if (!root_init()) {
    142                 printf(NAME ": Error while initializing driver.\n");
    143                 return -1;
    144         }
    145        
     135        printf(NAME ": HelenOS root device driver\n"); 
    146136        return driver_main(&root_driver);
    147137}
Note: See TracChangeset for help on using the changeset viewer.