Changeset 13eecc4 in mainline


Ignore:
Timestamp:
2019-02-06T17:30:48Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e2f332c
Parents:
a1f173d
git-author:
Jakub Jermar <jakub@…> (2019-01-20 12:15:28)
git-committer:
Jakub Jermar <jakub@…> (2019-02-06 17:30:48)
Message:

Add virtio-blk driver

Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    ra1f173d r13eecc4  
    145145        nic/ar9271 \
    146146        nic/virtio-net \
    147         block/ahci
     147        block/ahci \
     148        block/virtio-blk
    148149
    149150RD_DRV_CFG =
  • tools/ew.py

    ra1f173d r13eecc4  
    135135        hdisk_mk()
    136136
    137         return ' -drive file=hdisk.img,index=0,media=disk,format=raw'
     137        hdd_options = ''
     138        if 'hdd' in overrides.keys():
     139                if 'ata' in overrides['hdd'].keys():
     140                        hdd_options += ''
     141                elif 'virtio-blk' in overrides['hdd'].keys():
     142                        hdd_options += ',if=virtio'
     143
     144        return ' -drive file=hdisk.img,index=0,media=disk,format=raw' + hdd_options
    138145
    139146def qemu_nic_ne2k_options():
     
    336343def usage():
    337344        print("%s - emulator wrapper for running HelenOS\n" % os.path.basename(sys.argv[0]))
    338         print("%s [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" %
     345        print("%s [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-hdd ata|virtio-blk] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" %
    339346            os.path.basename(sys.argv[0]))
    340347        print("-d\tDry run: do not run the emulation, just print the command line.")
     
    357364def run():
    358365        expect_nic = False
     366        expect_hdd = False
    359367        expect_qemu = False
    360368
     
    378386                        continue
    379387
     388                if expect_hdd:
     389                        expect_hdd = False
     390                        if not 'hdd' in overrides.keys():
     391                                overrides['hdd'] = {}
     392                        if sys.argv[i] == 'ata':
     393                                overrides['hdd']['ata'] = True
     394                        elif sys.argv[i] == 'virtio-blk':
     395                                overrides['hdd']['virtio-blk'] = True
     396                        else:
     397                                usage()
     398                                exit()
     399                        continue
     400
    380401                if expect_qemu:
    381402                        expect_qemu = False
     
    389410                elif sys.argv[i] == '-net' and i < len(sys.argv) - 1:
    390411                        expect_nic = True
     412                elif sys.argv[i] == '-hdd' and i < len(sys.argv) - 1:
     413                        expect_hdd = True
    391414                elif sys.argv[i] == '-nohdd':
    392415                        overrides['nohdd'] = True
  • uspace/Makefile

    ra1f173d r13eecc4  
    152152        drv/block/ddisk \
    153153        drv/block/usbmast \
     154        drv/block/virtio-blk \
    154155        drv/bus/adb/cuda_adb \
    155156        drv/bus/isa \
  • uspace/lib/virtio/virtio.c

    ra1f173d r13eecc4  
    6363        uintptr_t phys;
    6464        errno_t rc = dmamem_map_anonymous(buffers * size, 0,
    65             write ? AS_AREA_WRITE : AS_AREA_READ, 0, &phys, &virt);
     65            write ? AS_AREA_WRITE | AS_AREA_READ : AS_AREA_READ, 0, &phys,
     66            &virt);
    6667        if (rc != EOK)
    6768                return rc;
Note: See TracChangeset for help on using the changeset viewer.