]> Zhao Yanbai Git Server - minix.git/commit
Split block/character protocols and libdriver
authorDavid van Moolenbroek <david@minix3.org>
Tue, 22 Nov 2011 12:27:53 +0000 (13:27 +0100)
committerDavid van Moolenbroek <david@minix3.org>
Wed, 23 Nov 2011 13:06:37 +0000 (14:06 +0100)
commitb4d909d4151ffbb1ce2d0d9f77696c5757d3eb11
treecbf758761f790445b197da3820b53652db214c0d
parent7643f2b25ed612653ecd841f2de47935f98425fd
Split block/character protocols and libdriver

This patch separates the character and block driver communication
protocols. The old character protocol remains the same, but a new
block protocol is introduced. The libdriver library is replaced by
two new libraries: libchardriver and libblockdriver. Their exposed
API, and drivers that use them, have been updated accordingly.
Together, libbdev and libblockdriver now completely abstract away
the message format used by the block protocol. As the memory driver
is both a character and a block device driver, it now implements its
own message loop.

The most important semantic change made to the block protocol is that
it is no longer possible to return both partial results and an error
for a single transfer. This simplifies the interaction between the
caller and the driver, as the I/O vector no longer needs to be copied
back. Also, drivers are now no longer supposed to decide based on the
layout of the I/O vector when a transfer should be cut short. Put
simply, transfers are now supposed to either succeed completely, or
result in an error.

After this patch, the state of the various pieces is as follows:
- block protocol: stable
- libbdev API: stable for synchronous communication
- libblockdriver API: needs slight revision (the drvlib/partition API
  in particular; the threading API will also change shortly)
- character protocol: needs cleanup
- libchardriver API: needs cleanup accordingly
- driver restarts: largely unsupported until endpoint changes are
  reintroduced

As a side effect, this patch eliminates several bugs, hacks, and gcc
-Wall and -W warnings all over the place. It probably introduces a
few new ones, too.

Update warning: this patch changes the protocol between MFS and disk
drivers, so in order to use old/new images, the MFS from the ramdisk
must be used to mount all file systems.
114 files changed:
common/include/Makefile.inc
common/include/minix/audio_fw.h
common/include/minix/bdev.h
common/include/minix/blockdriver.h [new file with mode: 0644]
common/include/minix/blockdriver_mt.h [new file with mode: 0644]
common/include/minix/chardriver.h [new file with mode: 0644]
common/include/minix/com.h
common/include/minix/devio.h
common/include/minix/driver.h
common/include/minix/driver_mt.h [deleted file]
common/include/minix/drvlib.h
common/include/minix/ipc.h
drivers/acpi/Makefile
drivers/ahci/Makefile
drivers/ahci/ahci.c
drivers/amddev/Makefile
drivers/amddev/amddev.c
drivers/at_wini/Makefile
drivers/at_wini/at_wini.c
drivers/at_wini/at_wini.h
drivers/audio/Makefile.inc
drivers/audio/es1370/Makefile
drivers/audio/es1370/ak4531.c
drivers/audio/es1370/es1370.c
drivers/audio/es1370/pci_helper.c
drivers/audio/es1371/es1371.c
drivers/audio/es1371/pci_helper.c
drivers/audio/es1371/sample_rate_converter.c
drivers/audio/sb16/mixer.c
drivers/audio/sb16/sb16.c
drivers/bios_wini/Makefile
drivers/bios_wini/bios_wini.c
drivers/filter/Makefile
drivers/filter/crc.c
drivers/filter/driver.c
drivers/filter/inc.h
drivers/filter/main.c
drivers/filter/sum.c
drivers/filter/util.c
drivers/floppy/Makefile
drivers/floppy/floppy.c
drivers/floppy/floppy.h
drivers/floppy/liveupdate.c
drivers/hello/Makefile
drivers/hello/hello.c
drivers/log/Makefile
drivers/log/log.c
drivers/log/log.h
drivers/memory/Makefile
drivers/memory/memory.c
drivers/pci/Makefile
drivers/printer/Makefile
drivers/printer/printer.c
drivers/random/Makefile
drivers/random/main.c
drivers/readclock/Makefile
drivers/ti1225/Makefile
drivers/ti1225/ti1225.c
drivers/tty/Makefile
drivers/tty/console.c
drivers/tty/keyboard.c
drivers/tty/pty.c
drivers/tty/rs232.c
drivers/tty/tty.c
lib/Makefile
lib/libaudiodriver/audio_fw.c
lib/libbdev/bdev.c
lib/libbdev/ipc.c
lib/libblockdriver/Makefile [moved from lib/libdriver/Makefile with 78% similarity]
lib/libblockdriver/driver.c [new file with mode: 0644]
lib/libblockdriver/driver.h [new file with mode: 0644]
lib/libblockdriver/driver_mt.c [moved from lib/libdriver/driver_mt.c with 74% similarity]
lib/libblockdriver/driver_st.c [new file with mode: 0644]
lib/libblockdriver/drvlib.c [moved from lib/libdriver/drvlib.c with 75% similarity]
lib/libblockdriver/event.c [moved from lib/libdriver/event.c with 65% similarity]
lib/libblockdriver/event.h [new file with mode: 0644]
lib/libblockdriver/mq.c [moved from lib/libdriver/mq.c with 83% similarity]
lib/libblockdriver/mq.h [new file with mode: 0644]
lib/libchardriver/Makefile [new file with mode: 0644]
lib/libchardriver/chardriver.c [moved from lib/libdriver/driver.c with 70% similarity]
lib/libdriver/driver.h [deleted file]
lib/libdriver/driver_st.c [deleted file]
lib/libdriver/event.h [deleted file]
lib/libdriver/mq.h [deleted file]
servers/apfs/Makefile
servers/apfs/main.c
servers/avfs/device.c
servers/avfs/dmap.c
servers/avfs/filedes.c
servers/avfs/main.c
servers/avfs/misc.c
servers/avfs/open.c
servers/avfs/proto.h
servers/ext2/cache.c
servers/ext2/super.c
servers/inet/Makefile
servers/inet/inet.c
servers/iso9660fs/cache.c
servers/lwip/Makefile
servers/lwip/lwip.c
servers/mfs/cache.c
servers/mfs/main.c
servers/mfs/super.c
servers/pfs/Makefile
servers/pfs/main.c
servers/vfs/device.c
servers/vfs/dmap.c
servers/vfs/filedes.c
servers/vfs/main.c
servers/vfs/misc.c
servers/vfs/open.c
servers/vfs/proto.h
share/mk/bsd.prog.mk
test/blocktest/blocktest.c