ARM updates

Due to the ABI we are using we have to use the earm architecture
moniker for the build system to behave correctly. This involves
then some headers to move around.

There is also a few related Makefile updates as well as minor
source code corrections.
This commit is contained in:
Lionel Sambuc 2013-01-13 17:20:11 +01:00
parent b86af8be0b
commit b1c4ba4ab6
151 changed files with 2525 additions and 1315 deletions

View file

@ -22,7 +22,7 @@
*/
.L_overflow:
#if !defined(_KERNEL) && !defined(_STANDALONE)
#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(__minix)
mov r0, #8 /* SIGFPE */
bl PIC_SYM(_C_LABEL(raise), PLT) /* raise it */
mov r0, #0

View file

@ -0,0 +1,93 @@
./boot/minix/.temp/mod07_tty minix-sys
./boot/minix/.temp/mod08_mfs minix-sys
./boot/minix/.temp/mod09_vm minix-sys
./boot/minix/.temp/mod10_pfs minix-sys
./boot/minix/.temp/mod11_init minix-sys
./multiboot/mod07_tty minix-sys
./multiboot/mod08_mfs minix-sys
./multiboot/mod09_vm minix-sys
./multiboot/mod10_pfs minix-sys
./multiboot/mod11_init minix-sys
./usr/include/arm/aeabi.h minix-sys
./usr/include/arm/ansi.h minix-sys
./usr/include/arm/arm26 minix-sys
./usr/include/arm/arm26/types.h minix-sys
./usr/include/arm/arm32 minix-sys
./usr/include/arm/arm32/param.h minix-sys
./usr/include/arm/arm32/types.h minix-sys
./usr/include/arm/arm32/vmparam.h minix-sys
./usr/include/arm/asm.h minix-sys
./usr/include/arm/bswap.h minix-sys
./usr/include/arm/byte_swap.h minix-sys
./usr/include/arm/cdefs.h minix-sys
./usr/include/arm/cpu.h minix-sys
./usr/include/arm/disklabel.h minix-sys
./usr/include/arm/elf_machdep.h minix-sys
./usr/include/arm/endian.h minix-sys
./usr/include/arm/endian_machdep.h minix-sys
./usr/include/arm/float.h minix-sys
./usr/include/arm/ieeefp.h minix-sys
./usr/include/arm/ieee.h minix-sys
./usr/include/arm/int_const.h minix-sys
./usr/include/arm/int_fmtio.h minix-sys
./usr/include/arm/int_limits.h minix-sys
./usr/include/arm/int_mwgwtypes.h minix-sys
./usr/include/arm/int_types.h minix-sys
./usr/include/arm/limits.h minix-sys
./usr/include/arm/lock.h minix-sys
./usr/include/arm/math.h minix-sys
./usr/include/arm/mcontext.h minix-sys
./usr/include/arm minix-sys
./usr/include/arm/mutex.h minix-sys
./usr/include/arm/param.h minix-sys
./usr/include/arm/profile.h minix-sys
./usr/include/arm/rwlock.h minix-sys
./usr/include/arm/setjmp.h minix-sys
./usr/include/arm/signal.h minix-sys
./usr/include/arm/types.h minix-sys
./usr/include/arm/wchar_limits.h minix-sys
./usr/include/evbarm/ansi.h minix-sys
./usr/include/evbarm/archconst.h minix-sys
./usr/include/evbarm/archtypes.h minix-sys
./usr/include/evbarm/asm.h minix-sys
./usr/include/evbarm/bswap.h minix-sys
./usr/include/evbarm/cdefs.h minix-sys
./usr/include/evbarm/compat_jmp_buf.h minix-sys
./usr/include/evbarm/cpu.h minix-sys
./usr/include/evbarm/disklabel.h minix-sys
./usr/include/evbarm/diskparm.h minix-sys
./usr/include/evbarm/elf.h minix-sys
./usr/include/evbarm/elf_machdep.h minix-sys
./usr/include/evbarm/endian.h minix-sys
./usr/include/evbarm/endian_machdep.h minix-sys
./usr/include/evbarm/float.h minix-sys
./usr/include/evbarm/ieeefp.h minix-sys
./usr/include/evbarm/ieee.h minix-sys
./usr/include/evbarm/int_const.h minix-sys
./usr/include/evbarm/interrupt.h minix-sys
./usr/include/evbarm/int_fmtio.h minix-sys
./usr/include/evbarm/int_limits.h minix-sys
./usr/include/evbarm/int_mwgwtypes.h minix-sys
./usr/include/evbarm/int_types.h minix-sys
./usr/include/evbarm/ipcconst.h minix-sys
./usr/include/evbarm/limits.h minix-sys
./usr/include/evbarm/lock.h minix-sys
./usr/include/evbarm/math.h minix-sys
./usr/include/evbarm/mcontext.h minix-sys
./usr/include/evbarm/memory.h minix-sys
./usr/include/evbarm minix-sys
./usr/include/evbarm/multiboot.h minix-sys
./usr/include/evbarm/mutex.h minix-sys
./usr/include/evbarm/param.h minix-sys
./usr/include/evbarm/partition.h minix-sys
./usr/include/evbarm/profile.h minix-sys
./usr/include/evbarm/rwlock.h minix-sys
./usr/include/evbarm/setjmp.h minix-sys
./usr/include/evbarm/signal.h minix-sys
./usr/include/evbarm/stackframe.h minix-sys
./usr/include/evbarm/types.h minix-sys
./usr/include/evbarm/vm.h minix-sys
./usr/include/evbarm/vmparam.h minix-sys
./usr/include/evbarm/wchar_limits.h minix-sys
./usr/include/i386 minix-sys obsolete
./usr/mdec minix-sys

View file

@ -0,0 +1,151 @@
./boot/minix/.temp/mod07_log minix-sys
./boot/minix/.temp/mod08_tty minix-sys
./boot/minix/.temp/mod09_mfs minix-sys
./boot/minix/.temp/mod10_vm minix-sys
./boot/minix/.temp/mod11_pfs minix-sys
./boot/minix/.temp/mod12_init minix-sys
./etc/system.conf.d/atl2 minix-sys
./etc/system.conf.d/dec21140A minix-sys
./etc/system.conf.d/e1000 minix-sys
./etc/system.conf.d/fxp minix-sys
./etc/system.conf.d/lance minix-sys
./etc/system.conf.d/rtl8139 minix-sys
./etc/system.conf.d/rtl8169 minix-sys
./multiboot/mod07_log minix-sys
./multiboot/mod08_tty minix-sys
./multiboot/mod09_mfs minix-sys
./multiboot/mod10_vm minix-sys
./multiboot/mod11_pfs minix-sys
./multiboot/mod12_init minix-sys
./sbin/ahci minix-sys
./sbin/at_wini minix-sys
./sbin/floppy minix-sys
./sbin/hgfs minix-sys
./sbin/readclock.drv minix-sys
./sbin/vbfs minix-sys
./usr/bin/atnormalize minix-sys
./usr/bin/autopart minix-sys
./usr/bin/dosdir minix-sys
./usr/bin/dosread minix-sys
./usr/bin/doswrite minix-sys
./usr/bin/fdisk minix-sys
./usr/bin/loadfont minix-sys
./usr/bin/partition minix-sys
./usr/bin/part minix-sys
./usr/bin/playwave minix-sys
./usr/bin/recwave minix-sys
./usr/bin/repartition minix-sys
./usr/bin/screendump minix-sys
./usr/include/i386 minix-sys
./usr/include/i386/ansi.h minix-sys
./usr/include/i386/archconst.h minix-sys
./usr/include/i386/archtypes.h minix-sys
./usr/include/i386/asm.h minix-sys
./usr/include/i386/bios.h minix-sys
./usr/include/i386/bootinfo.h minix-sys
./usr/include/i386/bswap.h minix-sys
./usr/include/i386/byte_swap.h minix-sys
./usr/include/i386/cdefs.h minix-sys
./usr/include/i386/cmos.h minix-sys
./usr/include/i386/compat_jmp_buf.h minix-sys
./usr/include/i386/cpu.h minix-sys
./usr/include/i386/disklabel.h minix-sys
./usr/include/i386/diskparm.h minix-sys
./usr/include/i386/elf.h minix-sys
./usr/include/i386/elf_machdep.h minix-sys
./usr/include/i386/endian.h minix-sys
./usr/include/i386/endian_machdep.h minix-sys
./usr/include/i386/fenv.h minix-sys
./usr/include/i386/float.h minix-sys
./usr/include/i386/fpu.h minix-sys
./usr/include/i386/ieeefp.h minix-sys
./usr/include/i386/ieee.h minix-sys
./usr/include/i386/int86.h minix-sys
./usr/include/i386/int_const.h minix-sys
./usr/include/i386/interrupt.h minix-sys
./usr/include/i386/int_fmtio.h minix-sys
./usr/include/i386/int_limits.h minix-sys
./usr/include/i386/int_mwgwtypes.h minix-sys
./usr/include/i386/int_types.h minix-sys
./usr/include/i386/ipcconst.h minix-sys
./usr/include/i386/limits.h minix-sys
./usr/include/i386/math.h minix-sys
./usr/include/i386/mcontext.h minix-sys
./usr/include/i386/memory.h minix-sys
./usr/include/i386/multiboot.h minix-sys
./usr/include/i386/mutex.h minix-sys
./usr/include/i386/npx.h minix-sys
./usr/include/i386/param.h minix-sys
./usr/include/i386/partition.h minix-sys
./usr/include/i386/pci_amd.h minix-sys
./usr/include/i386/pci.h minix-sys
./usr/include/i386/pci_intel.h minix-sys
./usr/include/i386/pci_sis.h minix-sys
./usr/include/i386/pci_via.h minix-sys
./usr/include/i386/pio.h minix-sys
./usr/include/i386/ports.h minix-sys
./usr/include/i386/profile.h minix-sys
./usr/include/i386/rwlock.h minix-sys
./usr/include/i386/setjmp.h minix-sys
./usr/include/i386/signal.h minix-sys
./usr/include/i386/stackframe.h minix-sys
./usr/include/i386/types.h minix-sys
./usr/include/i386/vm.h minix-sys
./usr/include/i386/vmparam.h minix-sys
./usr/include/i386/wchar_limits.h minix-sys
./usr/include/minix/vassert.h minix-sys
./usr/include/x86/bootinfo.h minix-sys
./usr/include/x86/cpu.h minix-sys
./usr/include/x86/float.h minix-sys
./usr/include/x86/ieeefp.h minix-sys
./usr/include/x86/ieee.h minix-sys
./usr/include/x86/math.h minix-sys
./usr/include/x86 minix-sys
./usr/include/x86/mutex.h minix-sys
./usr/include/x86/pio.h minix-sys
./usr/include/x86/rwlock.h minix-sys
./usr/lib/libhgfs.a minix-sys
./usr/lib/libhgfs_pic.a minix-sys
./usr/lib/libm387.a minix-sys
./usr/lib/libm387_pic.a minix-sys
./usr/lib/libm387.so.0.0 minix-sys
./usr/lib/libm387.so.0 minix-sys
./usr/lib/libm387.so minix-sys
./usr/lib/libvassert.a minix-sys
./usr/lib/libvboxfs.a minix-sys
./usr/lib/libvboxfs_pic.a minix-sys
./usr/mdec minix-sys
./usr/mdec/boot_monitor minix-sys
./usr/mdec/bootxx_cd9660 minix-sys
./usr/mdec/bootxx_ext2fs minix-sys
./usr/mdec/bootxx_minixfs3 minix-sys
./usr/mdec/gptmbr.bin minix-sys
./usr/mdec/mbr_bootsel minix-sys
./usr/mdec/mbr_com0_9600 minix-sys
./usr/mdec/mbr_com0 minix-sys
./usr/mdec/mbr_ext minix-sys
./usr/mdec/mbr minix-sys
./usr/sbin/acpi minix-sys
./usr/sbin/amddev minix-sys
./usr/sbin/atl2 minix-sys
./usr/sbin/dec21140A minix-sys
./usr/sbin/dp8390 minix-sys
./usr/sbin/dpeth minix-sys
./usr/sbin/e1000 minix-sys
./usr/sbin/es1370 minix-sys
./usr/sbin/es1371 minix-sys
./usr/sbin/fbd minix-sys
./usr/sbin/filter minix-sys
./usr/sbin/fxp minix-sys
./usr/sbin/hello minix-sys
./usr/sbin/lance minix-sys
./usr/sbin/log minix-sys
./usr/sbin/orinoco minix-sys
./usr/sbin/pci minix-sys
./usr/sbin/printer minix-sys
./usr/sbin/random minix-sys
./usr/sbin/rtl8139 minix-sys
./usr/sbin/rtl8169 minix-sys
./usr/sbin/sb16 minix-sys
./usr/sbin/ti1225 minix-sys
./usr/sbin/vbox minix-sys

File diff suppressed because it is too large Load diff

View file

@ -5,17 +5,29 @@
.if ${MKIMAGEONLY} == "yes"
# memory driver must be last for ramdisk image
SUBDIR= at_wini floppy log tty pci ramdisk .WAIT memory
.else
# memory driver must be last for ramdisk image
SUBDIR+= ahci amddev atl2 at_wini audio dec21140A dp8390 dpeth \
e1000 fbd filter floppy fxp hello lance log mmc orinoco pci printer \
random readclock rtl8139 rtl8169 ti1225 tty vbox acpi \
ramdisk .WAIT memory
.if ${MACHINE_ARCH} == "i386"
SUBDIR= at_wini floppy log tty pci
.endif
.if ${MACHINE_ARCH} == "earm"
SUBDIR= tty
.endif
.else # ${MKIMAGEONLY} != "yes"
.if ${MACHINE_ARCH} == "i386"
SUBDIR= ahci amddev atl2 at_wini audio dec21140A dp8390 dpeth \
e1000 fbd filter floppy fxp hello lance log mmc orinoco pci printer \
random readclock rtl8139 rtl8169 ti1225 tty vbox acpi
.endif
.if ${MACHINE_ARCH} == "earm"
SUBDIR= mmc tty
.endif
.endif # ${MKIMAGEONLY} != "yes"
# memory driver must be last for ramdisk image
SUBDIR+= ramdisk .WAIT memory
.include <bsd.subdir.mk>

View file

@ -348,13 +348,13 @@ static int do_add(message *m)
size, start, proc);
#endif
if (start % I386_PAGE_SIZE)
if (start % PAGE_SIZE)
{
printf("amddev`do_add: bad start 0x%x from proc %d\n",
start, proc);
return EINVAL;
}
if (size % I386_PAGE_SIZE)
if (size % PAGE_SIZE)
{
printf("amddev`do_add: bad size 0x%x from proc %d\n",
size, proc);
@ -393,13 +393,13 @@ static int do_add4pci(const message *m)
"amddev`do_add4pci: got request for 0x%x@0x%lx from %d for pci dev %u.%u.%u\n",
size, start, proc, pci_bus, pci_dev, pci_func);
if (start % I386_PAGE_SIZE)
if (start % PAGE_SIZE)
{
printf("amddev`do_add4pci: bad start 0x%lx from proc %d\n",
start, proc);
return EINVAL;
}
if (size % I386_PAGE_SIZE)
if (size % PAGE_SIZE)
{
printf("amddev`do_add4pci: bad size 0x%x from proc %d\n",
size, proc);
@ -442,9 +442,9 @@ static void add_range(phys_bytes busaddr, phys_bytes size)
printf("add_range: mapping 0x%x@0x%x\n", size, busaddr);
#endif
for (o= 0; o<size; o += I386_PAGE_SIZE)
for (o= 0; o<size; o += PAGE_SIZE)
{
u32_t bit= (busaddr+o)/I386_PAGE_SIZE;
u32_t bit= (busaddr+o)/PAGE_SIZE;
table[bit/8] &= ~(1U << (bit % 8));
}
}
@ -458,9 +458,9 @@ static void del_range(phys_bytes busaddr, phys_bytes size)
printf("del_range: mapping 0x%x@0x%x\n", size, busaddr);
#endif
for (o= 0; o<size; o += I386_PAGE_SIZE)
for (o= 0; o<size; o += PAGE_SIZE)
{
u32_t bit= (busaddr+o)/I386_PAGE_SIZE;
u32_t bit= (busaddr+o)/PAGE_SIZE;
table[bit/8] |= (1 << (bit % 8));
}
}

View file

@ -554,21 +554,21 @@ static void map_hw_buffer(t_or *orp)
char *buf, *abuf;
hermes_t *hw = &(orp->hw);
/* This way, the buffer will be at least I386_PAGE_SIZE big: see
/* This way, the buffer will be at least PAGE_SIZE big: see
* calculation with the offset */
size = 2 * I386_PAGE_SIZE;
size = 2 * PAGE_SIZE;
buf = (char *)malloc(size);
if(buf == NULL)
panic("map_hw_buffer: cannot malloc size: %d", size);
/* Let the mapped memory by I386_PAGE_SIZE aligned */
o = I386_PAGE_SIZE - ((vir_bytes)buf % I386_PAGE_SIZE);
/* Let the mapped memory by PAGE_SIZE aligned */
o = PAGE_SIZE - ((vir_bytes)buf % PAGE_SIZE);
abuf = buf + o;
#if 0
r = sys_vm_map(SELF, 1, (vir_bytes)abuf,
1 * I386_PAGE_SIZE, (phys_bytes)orp->or_base_port);
1 * PAGE_SIZE, (phys_bytes)orp->or_base_port);
#else
r = ENOSYS;
#endif

View file

@ -1564,8 +1564,8 @@ static void complete_bars(void)
if (!(pcidev[i].pd_bar[j].pb_flags & PBF_INCOMPLETE))
continue;
size= pcidev[i].pd_bar[j].pb_size;
if (size < I386_PAGE_SIZE)
size= I386_PAGE_SIZE;
if (size < PAGE_SIZE)
size= PAGE_SIZE;
base= memgap_high-size;
base &= ~(u32_t)(size-1);
if (base < memgap_low)

View file

@ -2,93 +2,110 @@
.include <bsd.own.mk>
# Remove "drivers/ramdisk" component from path
PROGROOT:= ${.OBJDIR:S,drivers/ramdisk,,}
TOOL_PWD_MKDB?= ${NETBSDSRCDIR}/usr.sbin/pwd_mkdb/pwd_mkdb
install:
all:
#
# Add a few defines we are going to use during the image
# creation to determine what features and binaries to include
# in the final image
# ACPI do we have/include the acpi binary
# RAMDISK_SMALL is the script called with MKSMALL=yes
# DYNAMIC does the ramdisk contain dynamic binaries?
RAMDISK_INC_ACPI=0
RAMDISK_SMALL=0
RAMDISK_DYNAMIC=0
RAMDISK_INC_ACPI= 0
RAMDISK_SMALL= 0
RAMDISK_DYNAMIC= 0
# the name of the proto file to use
PROTO= proto
RAMDISK_DEFINES= \
-DRAMDISK_INC_ACPI=${RAMDISK_INC_ACPI} \
-DRAMDISK_SMALL=${RAMDISK_SMALL} \
-DRAMDISK_DYNAMIC=${RAMDISK_DYNAMIC}
PROG_DRIVERS=at_wini floppy pci
PROG_COMMANDS=cdprobe loadramdisk mount fsck.mfs sysenv sh \
service
PROG_SERVERS=mfs procfs
PROG_USRSBIN=pwd_mkdb
# The name of the proto file to use
PROTO= proto
.if ${LDSTATIC} == "-dynamic"
RAMDISK_DYNAMIC=1
PROG_LIBEXEC+=ld.elf_so
PROG_LIBS+=libc libminlib libcompat_minix libterminfo
.endif
# Common to all architectures
ETC= system.conf master.passwd
EXTRA= rc mtab
PROTO_FILES= proto.common.etc proto.common.dynamic proto.dev
PROG_DRIVERS=
PROG_COMMANDS= mount fsck.mfs sh service
PROG_SERVERS= mfs
PROG_USRSBIN=
PROG_BIN=
PROGRAMS=${PROG_DRIVERS} ${PROG_COMMANDS} ${PROG_SERVERS} ${PROG_USRSBIN} ${PROG_LIBEXEC}
EXTRA=system.conf master.passwd rs.single
PROTO_FILES=proto.common.etc proto.common.dynamic proto.dev
.if ${MACHINE_ARCH} == "i386"
ETC+= rs.single
PROG_DRIVERS+= at_wini floppy pci
PROG_COMMANDS+= cdprobe loadramdisk sysenv
PROG_SERVERS+= procfs
PROG_USRSBIN+= pwd_mkdb
.if ${MKSMALL} != "yes"
RAMDISK_SMALL=1
PROG_DRIVERS+= ahci
PROG_SERVERS+= ext2
RAMDISK_SMALL= 1
PROG_DRIVERS+= ahci
PROG_SERVERS+= ext2
.endif
.if ${MKACPI} != "no"
PROG_DRIVERS+= acpi
RAMDISK_INC_ACPI=1
RAMDISK_INC_ACPI= 1
PROG_DRIVERS+= acpi
.endif
.endif # ${MACHINE_ARCH} == "i386"
.if ${MACHINE_ARCH} == "earm"
EXTRA+= mylogin.sh
PROG_DRIVERS+= mmc tty
PROG_COMMANDS+= cp dd getty ls time sync sleep stty umount
PROG_BIN+= cat rm
PROTO= proto.arm.small
.endif # ${MACHINE_ARCH} == "earm"
.if ${LDSTATIC} == "-dynamic"
RAMDISK_DYNAMIC= 1
PROG_LIBEXEC+= ld.elf_so
PROG_LIBS+= libc libminlib libcompat_minix libterminfo
.endif
PROGRAMS=${PROG_DRIVERS} ${PROG_COMMANDS} ${PROG_SERVERS} \
${PROG_USRSBIN} ${PROG_BIN} ${PROG_LIBEXEC}
CPPFLAGS+= -I${NETBSDSRCDIR}/servers
CLEANFILES += ${PROGRAMS} ${SCRIPTS} ${EXTRA} image image.c t proto.gen
# LSC We have to take care of not erasing the source file, so never add EXTRA
# to CLEANFILES
CLEANFILES += ${PROGRAMS} ${SCRIPTS} ${ETC} image image.c t proto.gen
CLEANFILES += ${LIBRARIES}
CLEANFILES += ${PROG_LIBEXEC}
CLEANFILES += ${.OBJDIR}/etc/*
image: proto.gen ${EXTRA} mtab rc pwd.db spwd.db passwd
${_MKMSG_CREATE} "Generating ramdisk image"
${TOOL_MKFSMFS} image proto.gen || { rm -f image; false; }
# if fsck.mfs -s image | grep -q CLEAN; \
# then : ; \
# else echo "CLEAN sanity check of image failed." ; \
# echo "(Perhaps install current mkfs and fsck.)" ; \
# rm -f image; false; \
# fi
#############################################################
# LSC Below this point the rules should not be modified
#############################################################
# LSC ramdisk rc file != /etc/rc
# mtab not empty!, force execution of the rule to ensure installation
# Conditionnally execute the command if the target file already exists
# I have to place .PHONY for the target to work as expected, but I cannot
# execute the command during an in-tree build (= make xxx)
.for file in rc mtab ${PROTO} ${PROTO_FILES}
${file}: ${.CURDIR}/${file} .PHONY
[ -e $@ ] || ${INSTALL} $> $@
.endfor
# Tool to bootstrap the password db
TOOL_PWD_MKDB?= ${NETBSDSRCDIR}/usr.sbin/pwd_mkdb/pwd_mkdb
.for driver in ${PROG_DRIVERS}
${driver}: ${PROGROOT}/drivers/${driver}/${driver}
# Remove "drivers/ramdisk" component from path
PROGROOT:= ${.OBJDIR:S,drivers/ramdisk,,}
# Generate dependencies rules for config files
.for etc in ${ETC}
${etc}: ${NETBSDSRCDIR}/etc/${etc}
${INSTALL} $> $@
${PROGROOT}/drivers/${driver}/${driver}:
${MAKE} -C ${NETBSDSRCDIR}/drivers/${driver} all
.endfor
# LSC Force the regeneration of the proto file as it seems sometimes
# they are not copied over as needed.
# LSC ramdisk rc file != /etc/rc && mtab not empty!
.for file in ${EXTRA} ${PROTO} ${PROTO_FILES}
${file}: ${NETBSDSRCDIR}/drivers/ramdisk/${file} .PHONY
${INSTALL} $> $@
.endfor
# Generate dependencies rules for dynamic libraries, if needed
.for lib in ${PROG_LIBS}
PROGRAMS+=${lib}.so.0
PROGRAMS+= ${lib}.so.0
CLEANFILES += ${lib}.so.0
${lib}.so.0:${PROGROOT}/lib/${lib}/${lib}.so.0
${INSTALL} $> $@
@ -97,48 +114,37 @@ ${PROGROOT}/lib/${lib}/${lib}.so.0:
${MAKE} -C ${NETBSDSRCDIR}/lib/${lib} all
.endfor
.for libexec in ${PROG_LIBEXEC}
${libexec}:${PROGROOT}/libexec/${libexec}/${libexec}
# Generate dependencies rules for binaries
dir.sh:= ash
.for srcdir in bin commands drivers libexec servers
.for prog in ${PROG_${srcdir:tu}}
${prog}: ${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}
${INSTALL} $> $@
${PROGROOT}/libexec/${libexec}/${libexec}:
${MAKE} -C ${NETBSDSRCDIR}/libexec/${libexec} all
.endfor
${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}:
${MAKE} -C ${NETBSDSRCDIR}/${srcdir}/${dir.${prog}:U${prog}} all
.endfor # prog
.endfor # srcdir
.for cmd in ${PROG_COMMANDS}
.if ${cmd} == sh
dir.${cmd}=ash
.else
dir.${cmd}=${cmd}
.endif
${cmd}: ${PROGROOT}/commands/${dir.${cmd}}/${cmd}
# We have to do this as a separate loop, because USR.SBIN is not a valid
# make variable name.
.for prog in ${PROG_USRSBIN}
${prog}: ${PROGROOT}/usr.sbin/${dir.${prog}:U${prog}}/${prog}
${INSTALL} $> $@
${PROGROOT}/commands/$(dir.${cmd})/${cmd}:
${MAKE} -C ${NETBSDSRCDIR}/commands/${dir.${cmd}} all
${PROGROOT}/usr.sbin/${dir.${prog}:U${prog}}/${prog}:
${MAKE} -C ${NETBSDSRCDIR}/usr.sbin/${dir.${prog}:U${prog}} all
.endfor
.for etc in ${EXTRA}
${etc}: ${NETBSDSRCDIR}/etc/${etc}
${INSTALL} $> $@
.endfor
.for cmd in ${PROG_USRSBIN}
${cmd}: ${PROGROOT}/usr.sbin/${cmd}/${cmd}
${INSTALL} $> $@
${PROGROOT}/usr.sbin/${cmd}/${cmd}:
${MAKE} -C ${NETBSDSRCDIR}/usr.sbin/${cmd} all
.endfor
.for server in ${PROG_SERVERS}
${server}: ${PROGROOT}/servers/${server}/${server}
${INSTALL} $> $@
${PROGROOT}/servers/${server}/${server}:
${MAKE} -C ${NETBSDSRCDIR}/servers/${server} all
.endfor
image: proto.gen ${ETC} ${EXTRA} pwd.db spwd.db passwd
${_MKMSG_CREATE} "Generating ramdisk image"
${TOOL_MKFSMFS} image proto.gen || { rm -f image; false; }
# if fsck.mfs -s image | grep -q CLEAN; \
# then : ; \
# else echo "CLEAN sanity check of image failed." ; \
# echo "(Perhaps install current mkfs and fsck.)" ; \
# rm -f image; false; \
# fi
etc/master.passwd: ${NETBSDSRCDIR}/etc/master.passwd
rm -rf ${.OBJDIR}/etc/
@ -151,15 +157,12 @@ etc/master.passwd: ${NETBSDSRCDIR}/etc/master.passwd
pwd.db spwd.db passwd: etc/master.passwd
${INSTALL} etc/${@F} ${@F}
proto.gen: ${PROTO} ${PROTO_FILES} ${PROGRAMS}
${STRIP} ${PROGRAMS}
# We are using the c preprocessor to generate proto.gen
# used in the mkfs tool.
${TOOL_CAT} ${PROTO} | ${HOST_CC} \
-DRAMDISK_INC_ACPI=${RAMDISK_INC_ACPI} \
-DRAMDISK_SMALL=${RAMDISK_SMALL} \
-DRAMDISK_DYNAMIC=${RAMDISK_DYNAMIC} \
${RAMDISK_DEFINES} \
-traditional-cpp -E - | grep -v "^$$" | grep -v "#" >${.OBJDIR}/${.TARGET}
.include <minix.service.mk>

4
drivers/ramdisk/mylogin.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
echo Welcome
export PATH=$PATH:/mnt/bin:/mnt/usr/bin
exec /bin/sh

View file

@ -0,0 +1,34 @@
boot
0 0
d--755 0 0
bin d--755 0 0
mount ---755 0 0 mount
umount ---755 0 0 umount
sh ---755 0 0 sh
service ---755 0 0 service
getty ---755 0 0 getty
stty ---755 0 0 stty
cp ---755 0 0 cp
sync ---755 0 0 sync
sleep ---755 0 0 sleep
dd ---755 0 0 dd
time ---755 0 0 time
cat ---755 0 0 cat
ls ---755 0 0 ls
fsck.mfs ---755 0 0 fsck.mfs
$
sbin d--755 0 0
mmc ---755 0 0 mmc
mfs ---755 0 0 mfs
$
mnt d--755 0 0
$
usr d--755 0 0
bin d--755 0 0
login ---755 0 0 mylogin.sh
$
$
dev d--755 0 0
#include "proto.dev"
$
$

View file

@ -5,6 +5,12 @@
pwd.db ---644 0 0 pwd.db
spwd.db ---600 0 0 spwd.db
master.passwd ---600 0 0 master.passwd
#if defined(__i386)
rc ---755 0 0 rc
rs.single ---755 0 0 rs.single
#endif
#if defined(__arm__)
rc ---755 0 0 rc.arm
ttys ---644 0 0 ttys
#endif
$

16
drivers/ramdisk/rc.arm Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
# LSC FIXME quick hack, we should retink the rc script so we do not
# get two different script
set -e
exec >/dev/log
exec 2>/dev/log
exec </dev/null
#XXX
#/bin/service -c up /sbin/mmc -dev /dev/c0d0
#/bin/fsck.mfs -p /dev/c0d0p1
#/bin/mount /dev/c0d0p1 /mnt
exit

44
drivers/ramdisk/ttys Executable file
View file

@ -0,0 +1,44 @@
#
# from: @(#)ttys 5.1 (Berkeley) 4/17/89
#
# name getty type status comments
#
console "getty 115200" minix on secure
#ttyc1 getty minix on secure
#ttyc2 getty minix on secure
#ttyc3 getty minix on secure
tty00 "" unknown off secure
tty01 "" unknown off secure
ttyp0 "" network off
ttyp1 "" network off
ttyp2 "" network off
ttyp3 "" network off
ttyp4 "" network off
ttyp5 "" network off
ttyp6 "" network off
ttyp7 "" network off
ttyp8 "" network off
ttyp9 "" network off
ttypa "" network off
ttypb "" network off
ttypc "" network off
ttypd "" network off
ttype "" network off
ttypf "" network off
ttyq0 "" network off
ttyq1 "" network off
ttyq2 "" network off
ttyq3 "" network off
ttyq4 "" network off
ttyq5 "" network off
ttyq6 "" network off
ttyq7 "" network off
ttyq8 "" network off
ttyq9 "" network off
ttyqa "" network off
ttyqb "" network off
ttyqc "" network off
ttyqd "" network off
ttyqe "" network off
ttyqf "" network off

View file

@ -164,7 +164,7 @@ static void hw_init(struct port *pp, int devind)
v32 &= PCI_BAR_MEM_MASK; /* Clear low order bits in base */
pp->csr_ptr=
(struct csr *) vm_map_phys(SELF, (void *) v32, I386_PAGE_SIZE);
(struct csr *) vm_map_phys(SELF, (void *) v32, PAGE_SIZE);
if (pp->csr_ptr == MAP_FAILED)
panic("hw_init: vm_map_phys failed");

View file

@ -4,7 +4,9 @@
#
G_INCLUDES=-I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf
G_LIB2ADD=${GNUHOSTDIST}/gcc/config/floatunsidf.c ${GNUHOSTDIST}/gcc/config/floatunsisf.c
.if !defined(__MINIX)
G_LIB2ADDEH=${GNUHOSTDIST}/gcc/unwind-dw2.c ${GNUHOSTDIST}/gcc/unwind-dw2-fde-glibc.c ${GNUHOSTDIST}/gcc/unwind-sjlj.c ${GNUHOSTDIST}/gcc/gthr-gnat.c ${GNUHOSTDIST}/gcc/unwind-c.c
.endif
G_LIB2ADD_ST=
G_LIB1ASMFUNCS=_thumb1_case_sqi _thumb1_case_uqi _thumb1_case_shi _thumb1_case_uhi _thumb1_case_si _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _call_via_rX _interwork_call_via_rX _arm_fixunsdfsi _arm_fixunssfsi _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf _lshrdi3 _ashrdi3 _ashldi3 _clzsi2 _clzdi2
G_LIB1ASMSRC=arm/lib1funcs.asm

View file

@ -1,5 +1,5 @@
.include <bsd.own.mk>
SUBDIR= ${MACHINE}
SUBDIR= ${MACHINE_ARCH}
.include <bsd.subdir.mk>

View file

@ -1,5 +1,5 @@
INCSDIR= /usr/include/arm
INCSDIR= /usr/include/evbarm
INCS= archconst.h archtypes.h diskparm.h elf.h interrupt.h \
ipcconst.h memory.h multiboot.h partition.h \

View file

@ -17,6 +17,7 @@ struct cpu_info {
u32_t implementer;
u32_t part;
u32_t variant;
u32_t freq; /* in MHz */
u32_t revision;
};

View file

@ -1,58 +0,0 @@
# Makefile for arch-dependent kernel code
.include <bsd.own.mk>
HERE=${.CURDIR}/arch/${MACHINE_ARCH}
.PATH: ${HERE}
# objects we want unpaged from -lminlib, -lminc
MINLIB_OBJS_UNPAGED=get_bp.o
MINC_OBJS_UNPAGED=strcat.o strlen.o memcpy.o strcpy.o strncmp.o memset.o \
memmove.o strcmp.o atoi.o ctype_.o _stdfile.o strtol.o _errno.o errno.o
# udivdi3.o umoddi3.o qdivrem.o
SYS_OBJS_UNPAGED=kprintf.o vprintf.o assert.o stacktrace.o
LIBGCC_OBJS_UNPAGED=_divsi3.o _udivsi3.o _divdi3.o _udivdi3.o _umoddi3.o \
_dvmd_tls.o _aeabi_uldivmod.o _clzsi2.o bpabi.o
# some object files we give a symbol prefix (or namespace) of __k_unpaged_
# that must live in their own unique namespace.
#
.for UNPAGED_OBJ in head.o pre_init.o direct_tty_utils.o \
pg_utils.o klib.o omap_serial.o utility.o arch_reset.o \
${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED} ${LIBGCC_OBJS_UNPAGED}
unpaged_${UNPAGED_OBJ}: ${UNPAGED_OBJ}
${OBJCOPY} --prefix-symbols=__k_unpaged_ ${UNPAGED_OBJ} unpaged_${UNPAGED_OBJ}
UNPAGED_OBJS += unpaged_${UNPAGED_OBJ}
ORIG_UNPAGED_OBJS += ${UNPAGED_OBJ}
.endfor
# we have to extract some object files from libminc.a and libminlib.a
${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED} ${LIBGCC_OBJS_UNPAGED}: ${LIBMINLIB} ${LIBMINC} ${LIBSYS} ${LIBGCC}
${AR} x ${LIBMINLIB} ${MINLIB_OBJS_UNPAGED}
${AR} x ${LIBMINC} ${MINC_OBJS_UNPAGED}
${AR} x ${LIBSYS} ${SYS_OBJS_UNPAGED}
${AR} x ${LIBGCC} ${LIBGCC_OBJS_UNPAGED}
CLEANFILES+= $(ORIG_UNPAGED_OBJS)
SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c \
omap_serial.c omap_timer.c omap_intr.c exception.c \
io_intr.S klib.S memory.c \
protect.c direct_tty_utils.c arch_reset.c \
pg_utils.c phys_copy.S phys_memset.S exc.S
OBJS.kernel+= ${UNPAGED_OBJS}
klib.d mpx.d head.d: procoffsets.h
# It's OK to hardcode the arch as arm here as this and procoffsets.cf
# are arm-specific.
TMP=procoffsets.h.tmp
INCLS=../include/arch/arm/include/
PROCOFFSETSCF=procoffsets.cf
procoffsets.h: ${PROCOFFSETSCF} kernel.h proc.h ${INCLS}/stackframe.h ${INCLS}/archtypes.h
${_MKTARGET_CREATE}
${TOOL_CAT} ${HERE}/${PROCOFFSETSCF} | \
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} >$TMP && \
mv -f $TMP $@

View file

@ -0,0 +1,88 @@
# Makefile for arch-dependent kernel code
.include <bsd.own.mk>
HERE=${.CURDIR}/arch/${MACHINE_ARCH}
.PATH: ${HERE}
# objects we want unpaged from -lminlib
MINLIB_OBJS_UNPAGED=get_bp.o
get_bp.o: ${NETBSDSRCDIR}/lib/libminlib/${MACHINE_ARCH}/get_bp.S
# objects we want unpaged from -lsys
SYS_OBJS_UNPAGED=assert.o kprintf.o stacktrace.o vprintf.o
assert.o: ${NETBSDSRCDIR}/lib/libsys/assert.c
kprintf.o: ${NETBSDSRCDIR}/lib/libsys/kprintf.c
stacktrace.o: ${NETBSDSRCDIR}/lib/libsys/stacktrace.c
vprintf.o: ${NETBSDSRCDIR}/lib/libsys/vprintf.c
# objects we want unpaged from -lminc
MINC_OBJS_UNPAGED=findfp.o strcat.o strlen.o memcpy.o strcpy.o strncmp.o \
memset.o memmove.o strcmp.o atoi.o ctype_.o strtol.o \
_errno.o errno.o udivdi3.o umoddi3.o qdivrem.o
MINC_OBJS_UNPAGED+= divsi3.o __aeabi_uldivmod.o
#_udivsi3.o _divdi3.o _udivdi3.o _umoddi3.o _dvmd_tls.o _clzsi2.o bpabi.o
memcpy.o: ${NETBSDSRCDIR}/common/lib/libc/string/memcpy.c
memmove.o: ${NETBSDSRCDIR}/common/lib/libc/string/memmove.c
memset.o: ${NETBSDSRCDIR}/common/lib/libc/string/memset.c
strcat.o: ${NETBSDSRCDIR}/common/lib/libc/string/strcat.c
strlen.o: ${NETBSDSRCDIR}/common/lib/libc/string/strlen.c
strcpy.o: ${NETBSDSRCDIR}/common/lib/libc/string/strcpy.c
strcmp.o: ${NETBSDSRCDIR}/common/lib/libc/string/strcmp.c
strncmp.o: ${NETBSDSRCDIR}/common/lib/libc/string/strncmp.c
udivdi3.o: ${NETBSDSRCDIR}/common/lib/libc/quad/udivdi3.c
umoddi3.o: ${NETBSDSRCDIR}/common/lib/libc/quad/umoddi3.c
qdivrem.o: ${NETBSDSRCDIR}/common/lib/libc/quad/qdivrem.c
atoi.o: ${NETBSDSRCDIR}/lib/libc/stdlib/atoi.c
strtol.o: ${NETBSDSRCDIR}/lib/libc/stdlib/strtol.c
findfp.o: ${NETBSDSRCDIR}/lib/libc/stdio/findfp.c
ctype_.o: ${NETBSDSRCDIR}/lib/libc/gen/ctype_.c
_errno.o: ${NETBSDSRCDIR}/lib/libc/gen/_errno.c
errno.o: ${NETBSDSRCDIR}/lib/libc/gen/errno.c
divsi3.o: ${NETBSDSRCDIR}/common/lib/libc/arch/${MACHINE_GNU_ARCH}/gen/divsi3.S
__aeabi_uldivmod.o: ${NETBSDSRCDIR}/common/lib/libc/arch/${MACHINE_GNU_ARCH}/quad/__aeabi_uldivmod.S
# Specific flags needed to compile a few of the object files.
CPPFLAGS.strtol.c+= -I ${NETBSDSRCDIR}/common/lib/libc/stdlib
CPPFLAGS.ctype_.c+= -I ${NETBSDSRCDIR}/lib/libc/locale
CPPFLAGS._errno.c+= -I ${NETBSDSRCDIR}/lib/libc/include
CPPFLAGS.assert.c+= -I ${NETBSDSRCDIR}/lib/libc/include
CPPFLAGS.findfp.c+= -I ${NETBSDSRCDIR}/lib/libc/include
# some object files we give a symbol prefix (or namespace) of __k_unpaged_
# that must live in their own unique namespace.
#
.for unpaged_obj in head.o pre_init.o direct_tty_utils.o \
pg_utils.o klib.o omap_serial.o utility.o arch_reset.o \
${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED}
unpaged_${unpaged_obj}: ${unpaged_obj}
${OBJCOPY} --prefix-symbols=__k_unpaged_ ${.OBJDIR}/${unpaged_obj} $@
UNPAGED_OBJS += unpaged_${unpaged_obj}
ORIG_UNPAGED_OBJS += ${unpaged_obj}
.endfor
CLEANFILES+= ${ORIG_UNPAGED_OBJS}
SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c \
omap_serial.c omap_timer.c omap_intr.c exception.c \
io_intr.S klib.S memory.c \
protect.c direct_tty_utils.c arch_reset.c \
pg_utils.c phys_copy.S phys_memset.S exc.S
OBJS.kernel+= ${UNPAGED_OBJS}
klib.o mpx.o head.o: procoffsets.h
SRCS+= procoffsets.h
PROCOFFSETSCF=procoffsets.cf
.PATH: ${NETBSDSRCDIR}/include/arch/${MACHINE_ARCH}/include
procoffsets.h: ${PROCOFFSETSCF} kernel.h proc.h stackframe.h archtypes.h
${_MKTARGET_CREATE}
${TOOL_CAT} ${HERE}/${PROCOFFSETSCF} | \
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} >$@.tmp && \
mv -f $@.tmp $@
sconst.h: procoffsets.h
apic_asm.o head.o klib.o mpx.o: sconst.h

View file

@ -7,11 +7,11 @@
#include "kernel/proc.h"
#include "kernel/interrupt.h"
#include <minix/u64.h>
#include "glo.h"
#include "profile.h"
#include "kernel/glo.h"
#include "kernel/profile.h"
#include "spinlock.h"
#include "kernel/spinlock.h"
#ifdef CONFIG_SMP
#include "kernel/smp.h"

View file

@ -77,6 +77,7 @@ void cpu_identify(void)
cpu_info[cpu].arch = (midr >> 16) & 0xF;
cpu_info[cpu].part = (midr >> 4) & 0xFFF;
cpu_info[cpu].revision = midr & 0xF;
cpu_info[cpu].freq = 660; /* 660 Mhz hardcoded */
}
void arch_init(void)

View file

@ -3,7 +3,7 @@
/* sections */
#include <machine/vm.h>
#include "../../kernel.h"
#include "kernel/kernel.h"
#include <minix/config.h>
#include <minix/const.h>
#include <minix/com.h>
@ -41,7 +41,8 @@ multiboot_init:
mov r1, #0
push {r1} /* Terminate stack */
/* r0 holds kinfo_t ptr */
bl _C_LABEL(kmain)
ldr r2, =_C_LABEL(kmain)
bx r2
/* not reached */
hang:

View file

@ -95,6 +95,39 @@ int overlaps(multiboot_module_t *mod, int n, int cmp_mod)
return 0;
}
/* XXX: hard-coded stuff for modules */
#define MB_MODS_NR 12
#define MB_MODS_BASE 0x90000000
#define MB_MODS_ALIGN 0x00800000 /* 8 MB */
#define MB_MODS_SIZE 0x00004000 /* 16 KB */
#define MB_MMAP_START MB_MODS_BASE
#define MB_MMAP_SIZE 0x10000000 /* 256 MB */
multiboot_module_t mb_modlist[MB_MODS_NR];
multiboot_memory_map_t mb_memmap;
void setup_mbi(multiboot_info_t *mbi)
{
memset(mbi, 0, sizeof(*mbi));
mbi->flags = MULTIBOOT_INFO_MODS | MULTIBOOT_INFO_MEM_MAP;
mbi->mods_count = MB_MODS_NR;
mbi->mods_addr = (u32_t)&mb_modlist;
int i;
for (i = 0; i < MB_MODS_NR; ++i) {
mb_modlist[i].mod_start = MB_MODS_BASE + i * MB_MODS_ALIGN;
mb_modlist[i].mod_end = mb_modlist[i].mod_start + MB_MODS_ALIGN - 1; mb_modlist[i].cmdline = 0;
}
mbi->mmap_addr = (void*)&mb_memmap;
mbi->mmap_length = sizeof(mb_memmap);
mb_memmap.size = sizeof(multiboot_memory_map_t);
mb_memmap.addr = MB_MMAP_START;
mb_memmap.len = MB_MMAP_SIZE;
mb_memmap.type = MULTIBOOT_MEMORY_AVAILABLE;
}
void get_parameters(u32_t ebx, kinfo_t *cbi)
{
multiboot_memory_map_t *mmap;
@ -109,7 +142,8 @@ void get_parameters(u32_t ebx, kinfo_t *cbi)
static char cmdline[BUF];
/* get our own copy of the multiboot info struct and module list */
memcpy((void *) mbi, (void *) ebx, sizeof(*mbi));
//memcpy((void *) mbi, (void *) ebx, sizeof(*mbi));
setup_mbi(mbi);
/* Set various bits of info for the higher-level kernel. */
cbi->mem_high_phys = 0;
@ -237,4 +271,3 @@ kinfo_t *pre_init(u32_t magic, u32_t ebx)
int send_sig(endpoint_t proc_nr, int sig_nr) { return 0; }
void minix_shutdown(timer_t *t) { arch_shutdown(RBT_PANIC); }
void busy_delay_ms(int x) { }

View file

@ -49,13 +49,13 @@ CPPFLAGS.findfp.c+= -I ${NETBSDSRCDIR}/lib/libc/include
# some object files we give a symbol prefix (or namespace) of __k_unpaged_
# that must live in their own unique namespace.
#
.for UNPAGED_OBJ in head.o pre_init.o direct_tty_utils.o io_outb.o \
.for unpaged_obj in head.o pre_init.o direct_tty_utils.o io_outb.o \
io_inb.o pg_utils.o klib.o utility.o arch_reset.o \
${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED}
unpaged_${UNPAGED_OBJ}: ${UNPAGED_OBJ}
${OBJCOPY} --prefix-symbols=__k_unpaged_ ${.OBJDIR}/${UNPAGED_OBJ} $@
UNPAGED_OBJS += unpaged_${UNPAGED_OBJ}
ORIG_UNPAGED_OBJS += ${UNPAGED_OBJ}
unpaged_${unpaged_obj}: ${unpaged_obj}
${OBJCOPY} --prefix-symbols=__k_unpaged_ ${.OBJDIR}/${unpaged_obj} $@
UNPAGED_OBJS += unpaged_${unpaged_obj}
ORIG_UNPAGED_OBJS += ${unpaged_obj}
.endfor
CLEANFILES+= ${ORIG_UNPAGED_OBJS}
@ -104,5 +104,5 @@ procoffsets.h: ${PROCOFFSETSCF} kernel.h proc.h stackframe.h archtypes.h
mv -f $@.tmp $@
sconst.h: procoffsets.h
apic_asm.S head.S klib16.S klib.S mpx.S: sconst.h
apic_asm.o head.o klib.o mpx.o: sconst.h

View file

@ -42,8 +42,12 @@ SUBDIR+= libcompat_minix libblockdriver libchardriver \
libz libfetch libvtreefs libaudiodriver libmthread \
libexec libdevman libusb libasyn librmt \
libddekit libminixfs libbdev libelf libminc libcrypt libterminfo \
libvassert libutil libbz2 libprop \
libnetsock libpuffs libsffs libhgfs libvboxfs
libutil libbz2 libprop \
libnetsock libpuffs libsffs
.if (${MACHINE} == "i386")
SUBDIR += libvassert libhgfs libvboxfs
.endif
.if (${MKRUMP} != "no")
SUBDIR+= librumpclient

View file

@ -9,7 +9,7 @@ SRCS+= __aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
CPPFLAGS += -I.
CPPFLAGS += -DSOFTFLOAT
.if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb"
.if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb" || defined(__MINIX)
SRCS+= __aeabi_ldivmod.S __aeabi_uldivmod.S
SRCS+= __aeabi_lcmp.c __aeabi_ulcmp.c
SRCS+= fixunsgen_ieee754.c fixunssfsi_ieee754.c

View file

@ -1,36 +0,0 @@
# $NetBSD: genassym.cf,v 1.1 2012/09/27 11:20:20 skrll Exp $
#
# Copyright (c) 2012 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Nick Hudson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
include <sys/types.h>
include <ucontext.h>
define _UC_REGS_SP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
define _UC_REGS_PC offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])

View file

@ -1,14 +1,13 @@
# rts sources
HERE=${.CURDIR}/arch/${MACHINE_ARCH}/sys-minix
HERE=${ARCHDIR}/sys-minix
.PATH: ${HERE}
ARCHINCLS=${NETBSDSRCDIR}/include/arch/${MACHINE_ARCH}/include/
TMP=ucontextoffsets.h.tmp
CF=ucontextoffsets.cf
CF=${HERE}/ucontextoffsets.cf
INCS+=ucontextoffsets.h
ucontext.d: ucontextoffsets.h
ucontext.o: ucontextoffsets.h
SRCS+= \
__sigreturn.S \
@ -17,9 +16,12 @@ SRCS+= \
brksize.S \
ucontext.S
ucontextoffsets.h: ${CF} ${ARCHINCLS}/stackframe.h ${NETBSDSRCDIR}/sys/sys/ucontext.h
ucontextoffsets.h: ${CF}
ucontextoffsets.h: ${NETBSDSRCDIR}/sys/sys/ucontext.h
ucontextoffsets.h: ${NETBSDSRCDIR}/include/arch/${MACHINE_ARCH}/include/stackframe.h
ucontextoffsets.h:
${_MKTARGET_CREATE}
cat ${HERE}/$(CF) | \
cat ${CF} | \
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} >$TMP && \
mv -f $TMP $@

View file

@ -1,14 +1,13 @@
# rts sources
HERE=${.CURDIR}/arch/${MACHINE_ARCH}/sys-minix
HERE=${ARCHDIR}/sys-minix
.PATH: ${HERE}
ARCHINCLS=${NETBSDSRCDIR}/include/arch/${MACHINE_ARCH}/include/
TMP=ucontextoffsets.h.tmp
CF=ucontextoffsets.cf
CF=${HERE}/ucontextoffsets.cf
INCS+=ucontextoffsets.h
ucontext.d: ucontextoffsets.h
ucontext.o: ucontextoffsets.h
SRCS+= \
__sigreturn.S \
@ -17,9 +16,12 @@ SRCS+= \
brksize.S \
ucontext.S
ucontextoffsets.h: ${CF} ${ARCHINCLS}/stackframe.h ${NETBSDSRCDIR}/sys/sys/ucontext.h
ucontextoffsets.h: ${CF}
ucontextoffsets.h: ${NETBSDSRCDIR}/sys/sys/ucontext.h
ucontextoffsets.h: ${NETBSDSRCDIR}/include/arch/${MACHINE_ARCH}/include/stackframe.h
ucontextoffsets.h:
${_MKTARGET_CREATE}
cat ${HERE}/$(CF) | \
cat ${CF} | \
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} >$TMP && \
mv -f $TMP $@

View file

@ -80,7 +80,11 @@ void float_raise( fp_except flags )
info.si_code = FPE_FLTINV;
else if (flags & float_flag_inexact)
info.si_code = FPE_FLTRES;
#if !defined(__minix)
/* LSC FIXME: This kind of remove any interest to the function. We should
be using the minix equivalent, or do something appropriate. */
sigqueueinfo(getpid(), &info);
#endif /* !defined(__minix) */
}
}
#undef float_exception_mask

View file

@ -5,4 +5,4 @@ INCSDIR= /usr/include
INCS+= configfile.h
INCS+= compat/a.out.h
INCS+= net/gen/netdb.h net/gen/resolv.h net/gen/nameser.h
INCS+= sys/jmp_buf.h ${MACHINE_ARCH}/compat_jmp_buf.h
INCS+= sys/jmp_buf.h ${MACHINE}/compat_jmp_buf.h

View file

@ -12,6 +12,7 @@ LIBCSRCDIR= ${NETBSDSRCDIR}/lib/libc
CPPFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}
CPPFLAGS+= -D_LIBMINC
ARCHDIR?= ${LIBCSRCDIR}/arch/${MACHINE_CPU}
#
# Customized versions of libc functions.
#
@ -99,7 +100,7 @@ CLEANFILES+= errlist.c
isfinitef_ieee754.c isfinited_ieee754.c \
signbitf_ieee754.c signbitd_ieee754.c \
nanf.c
.PATH.c .PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/gen ${LIBCSRCDIR}/gen/minix \
.PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCSRCDIR}/gen/minix \
${LIBCSRCDIR}/gen ${LIBCSRCDIR}
SRCS+= ${i}
.endfor
@ -117,7 +118,7 @@ SRCS+= ${i}
# Import from string
.for i in strcspn.c strerror.c strerror_r.c strtol.c \
bcopy.S bzero.S
.PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string
.PATH.S: ${ARCHDIR}/string
.PATH.c: ${LIBCSRCDIR}/string
SRCS+= ${i}
CPPFLAGS.${i}+= -D_LIBC
@ -145,7 +146,7 @@ CPPFLAGS.${i}+= -I${LIBCSRCDIR}/locale
stime.c syscall.c _ucontext.c umask.c unlink.c waitpid.c \
brksize.S _ipc.S _senda.S ucontext.S mmap.c init.c
.PATH.c: ${LIBCSRCDIR}/sys-minix
.PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/sys-minix
.PATH.S: ${ARCHDIR}/sys-minix
SRCS+= ${i}
.endfor

View file

@ -3,3 +3,4 @@ SRCS+= memchr.c memcmp.c memcpy.c memmove.c memset.c \
strcat.c strchr.c strcmp.c strcpy.c strlen.c \
strncmp.c strrchr.c
SRCS+= bcmp.c
SRCS+= divsi3.S

View file

@ -75,6 +75,7 @@ SRCS= \
taskcall.c \
tickdelay.c \
timers.c \
tsc_util.c \
vm_brk.c \
vm_exit.c \
vm_fork.c \
@ -108,7 +109,6 @@ SRCS+= \
sys_voutl.c \
sys_voutw.c \
timing.c \
tsc_util.c \
vbox.c
.endif

View file

@ -179,6 +179,7 @@ _rtld_relocate_nonplt_objects(Obj_Entry *obj)
rdbg(("COPY (avoid in main)"));
break;
#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
case R_TYPE(TLS_DTPOFF32):
def = _rtld_find_symdef(symnum, obj, &defobj, false);
if (def == NULL)
@ -231,6 +232,7 @@ _rtld_relocate_nonplt_objects(Obj_Entry *obj)
obj->strtab + obj->symtab[symnum].st_name,
obj->path, (void *)tmp));
break;
#endif
default:
rdbg(("sym = %lu, type = %lu, offset = %p, "

View file

@ -18,19 +18,20 @@ PROGROOT:= ${MAKEOBJDIR:S,releasetools,,}
# Specify the programs that are part of the system image.
KERNEL= ${PROGROOT}/kernel/kernel
# PROGRAMS are in the order they should be loaded by boot
PROGRAMS= \
${PROGROOT}/servers/ds/ds \
${PROGROOT}/servers/rs/rs \
${PROGROOT}/servers/pm/pm \
${PROGROOT}/servers/sched/sched \
${PROGROOT}/servers/vfs/vfs \
${PROGROOT}/drivers/memory/memory \
${PROGROOT}/drivers/log/log \
${PROGROOT}/drivers/tty/tty \
${PROGROOT}/servers/mfs/mfs \
${PROGROOT}/servers/vm/vm \
${PROGROOT}/servers/pfs/pfs \
${PROGROOT}/servers/init/init
PROGRAMS+= ${PROGROOT}/servers/ds/ds
PROGRAMS+= ${PROGROOT}/servers/rs/rs
PROGRAMS+= ${PROGROOT}/servers/pm/pm
PROGRAMS+= ${PROGROOT}/servers/sched/sched
PROGRAMS+= ${PROGROOT}/servers/vfs/vfs
PROGRAMS+= ${PROGROOT}/drivers/memory/memory
.if ${MACHINE_ARCH} == "i386"
PROGRAMS+= ${PROGROOT}/drivers/log/log
.endif
PROGRAMS+= ${PROGROOT}/drivers/tty/tty
PROGRAMS+= ${PROGROOT}/servers/mfs/mfs
PROGRAMS+= ${PROGROOT}/servers/vm/vm
PROGRAMS+= ${PROGROOT}/servers/pfs/pfs
PROGRAMS+= ${PROGROOT}/servers/init/init
usage:
@echo " " >&2

View file

@ -9,8 +9,12 @@ SUBDIR= ds init mfs pfs pm rs sched vfs vm
.else
SUBDIR= ds ext2 hgfs inet init ipc is iso9660fs \
mfs pfs pm procfs rs sched vbfs vfs vm devman
SUBDIR= ds ext2 inet init ipc is iso9660fs \
mfs pfs pm procfs rs sched vfs vm devman
.if ${MACHINE_ARCH} == "i386"
SUBDIR+= hgfs vbfs
.endif
.endif

View file

@ -18,6 +18,7 @@
#include <sys/sem.h>
#include <sys/mman.h>
#include <machine/vm.h>
#include <machine/vmparam.h>
#include <sys/vm.h>
#include <time.h>

View file

@ -60,8 +60,8 @@ int do_shmget(message *m)
if (size <= 0)
return EINVAL;
/* round up to a multiple of PAGE_SIZE */
if (size % I386_PAGE_SIZE)
size += I386_PAGE_SIZE - size % I386_PAGE_SIZE;
if (size % PAGE_SIZE)
size += PAGE_SIZE - size % PAGE_SIZE;
if (size <= 0)
return EINVAL;
@ -115,9 +115,9 @@ int do_shmat(message *m)
addr = (vir_bytes) m->SHMAT_ADDR;
flag = m->SHMAT_FLAG;
if (addr && (addr % I386_PAGE_SIZE)) {
if (addr && (addr % PAGE_SIZE)) {
if (flag & SHM_RND)
addr -= (addr % I386_PAGE_SIZE);
addr -= (addr % PAGE_SIZE);
else
return EINVAL;
}
@ -169,8 +169,8 @@ void update_refcount_and_destroy(void)
j++;
} else {
int size = shm_list[i].shmid_ds.shm_segsz;
if (size % I386_PAGE_SIZE)
size += I386_PAGE_SIZE - size % I386_PAGE_SIZE;
if (size % PAGE_SIZE)
size += PAGE_SIZE - size % PAGE_SIZE;
minix_munmap((void *)shm_list[i].page, size);
}
}
@ -297,7 +297,7 @@ int do_shmctl(message *m)
s_info.shm_tot = 0;
for (i = 0; i < shm_list_nr; i++)
s_info.shm_tot +=
shm_list[i].shmid_ds.shm_segsz/I386_PAGE_SIZE;
shm_list[i].shmid_ds.shm_segsz/PAGE_SIZE;
s_info.shm_rss = s_info.shm_tot;
s_info.shm_swp = 0;
s_info.swap_attempts = 0;

View file

@ -312,7 +312,7 @@ static char *p_rts_flags_str(int flags)
* proctab_dmp *
*===========================================================================*/
#if defined(__i386__)
void proctab_dmp()
void proctab_dmp(void)
{
/* Proc table dump */
@ -341,6 +341,13 @@ void proctab_dmp()
}
#endif /* defined(__i386__) */
#if defined(__arm__)
void proctab_dmp(void)
{
/* LSC FIXME: Not implemented for arm */
}
#endif /* defined(__arm__) */
/*===========================================================================*
* procstack_dmp *
*===========================================================================*/

View file

@ -90,6 +90,7 @@ static void print_cpu(struct cpu_info * cpu_info, unsigned id)
{
buf_printf("%-16s: %d\n", "processor", id);
#if defined(__i386__)
switch (cpu_info->vendor) {
case CPU_VENDOR_INTEL:
buf_printf("%-16s: %s\n", "vendor_id", "GenuineIntel");
@ -109,8 +110,8 @@ static void print_cpu(struct cpu_info * cpu_info, unsigned id)
buf_printf("%-16s: %d\n", "cpu MHz", cpu_info->freq);
buf_printf("%-16s: ", "flags");
print_cpu_flags(cpu_info->flags);
buf_printf("\n");
#endif
}
void root_cpuinfo(void)

View file

@ -1,7 +1,10 @@
/* ProcFS - root.c - by Alen Stojanov and David van Moolenbroek */
#include "inc.h"
#if defined (__i386__)
#include <machine/pci.h>
#endif
#include <minix/dmap.h>
#include "cpuinfo.h"
#include "mounts.h"
@ -11,7 +14,9 @@ static void root_uptime(void);
static void root_loadavg(void);
static void root_kinfo(void);
static void root_meminfo(void);
#if defined(__i386__)
static void root_pci(void);
#endif
static void root_dmap(void);
static void root_ipcvecs(void);
@ -21,9 +26,13 @@ struct file root_files[] = {
{ "loadavg", REG_ALL_MODE, (data_t) root_loadavg },
{ "kinfo", REG_ALL_MODE, (data_t) root_kinfo },
{ "meminfo", REG_ALL_MODE, (data_t) root_meminfo },
#if defined(__i386__)
{ "pci", REG_ALL_MODE, (data_t) root_pci },
#endif
{ "dmap", REG_ALL_MODE, (data_t) root_dmap },
#if defined(__i386__)
{ "cpuinfo", REG_ALL_MODE, (data_t) root_cpuinfo },
#endif
{ "ipcvecs", REG_ALL_MODE, (data_t) root_ipcvecs },
{ "mounts", REG_ALL_MODE, (data_t) root_mounts },
{ NULL, 0, NULL }
@ -113,6 +122,7 @@ static void root_meminfo(void)
/*===========================================================================*
* root_pci *
*===========================================================================*/
#if defined(__i386__)
static void root_pci(void)
{
/* Print information about PCI devices present in the system.
@ -147,6 +157,7 @@ static void root_pci(void)
r = pci_next_dev(&devind, &vid, &did);
}
}
#endif /* defined(__i386__) */
/*===========================================================================*
* root_dmap *

Some files were not shown because too many files have changed in this diff Show more