2010-05-27 00:49:57 +02:00
|
|
|
# Makefile for memory driver (MEMORY)
|
2012-06-06 13:49:36 +02:00
|
|
|
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2010-05-27 00:49:57 +02:00
|
|
|
PROG= memory
|
2012-01-17 16:04:58 +01:00
|
|
|
SRCS= memory.c imgrd.mfs
|
|
|
|
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
|
2012-06-06 13:49:36 +02:00
|
|
|
MKBUILDEXT2RD?= no
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2012-06-06 13:49:36 +02:00
|
|
|
RAMDISK_PATH= ${NETBSDSRCDIR}/drivers/ramdisk
|
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.
2011-11-22 13:27:53 +01:00
|
|
|
DPADD+= ${LIBBLOCKDRIVER} ${LIBCHARDRIVER} ${LIBSYS}
|
|
|
|
LDADD+= -lblockdriver -lchardriver -lsys
|
2010-05-27 00:49:57 +02:00
|
|
|
|
|
|
|
MAN=
|
|
|
|
|
|
|
|
BINDIR?= /usr/sbin
|
|
|
|
|
2012-06-06 13:16:32 +02:00
|
|
|
CPPFLAGS.memory.c+= -I${NETBSDSRCDIR}
|
2012-01-17 16:04:58 +01:00
|
|
|
|
|
|
|
imgrd.d: touch-genfiles
|
|
|
|
touch-genfiles:
|
|
|
|
[ -e ../ramdisk/image ] || touch -t 197001020000.00 ../ramdisk/image
|
|
|
|
|
|
|
|
|
|
|
|
.SUFFIXES: .mfs .c .o
|
|
|
|
|
|
|
|
.mfs.o:
|
|
|
|
${_MKTARGET_CREATE}
|
2013-01-13 17:20:59 +01:00
|
|
|
${OBJCOPY} -Ibinary -B${MACHINE_CPU} -O${MACHINE_GNU_PLATFORM} $< $@
|
2012-01-17 16:04:58 +01:00
|
|
|
|
2012-10-26 15:22:39 +02:00
|
|
|
CLEANFILES+= ../ramdisk/image
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
../ramdisk/image: .PHONY
|
2012-05-01 16:43:09 +02:00
|
|
|
${MAKE} -C ${RAMDISK_PATH} image
|
|
|
|
|
2012-01-17 16:04:58 +01:00
|
|
|
CLEANFILES+= imgrd.mfs
|
2012-10-26 15:22:39 +02:00
|
|
|
imgrd.mfs: ../ramdisk/image
|
|
|
|
${HOST_LN} -fs ../ramdisk/image $@
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2013-02-28 11:06:24 +01:00
|
|
|
.include <minix.service.mk>
|