5 Commits

Author SHA1 Message Date
Serge Vakulenko
486f81f6ab Merge pull request #94 from gartnerd/master
These changes allow to compile RetroBSD on a Linux Mint host with 32bit libraries installed.
The simulator in "tools/virtualmips/pic32" seems to work fine.

* removed the -Wall compiler flag (hopefully this will be temporary) from makefile recipes to prevent errors from stopping compilation. It mostly fails on printf type functions because of string size conflicts.
* added the "-m32" flag so that compilation and linking produced 32bit executables. I'm not sure is if this is strictly necessary.
* copied Makefile.kconfig to Makefile.kconfigpic32. The files in the pic32 directory compile after making this change
* modified the code in config.h to explicitly tag those function that are externally defined. This is required by newer versions of gcc
* hacked config.y so that the lexer/compiler stopped complaining.
* commented out the "compp" variable in main.c because of size mismatch errors. It doesn't seem to be used for anything.
* added a system header file to tools/kconfig/mkswapconf.c so that the compiler could find included functions
2023-07-07 11:41:40 -07:00
David Gartner
a8ad228599 Updated code to compile on GNU/Linux 5.15.0-75-generic #82-Ubuntu SMP and Code Sourcery MIPS toolchain 2023-07-06 15:58:16 -06:00
Serge Vakulenko
72ca88362a Merge pull request #84 from calmsacibis995/patch-1
Update gettytab to change the default login banner from "2.11 BSD UNI…
2022-07-19 09:40:40 -07:00
calmsacibis995
d785bca2c8 Update gettytab to change the default login banner from "2.11 BSD UNIX" to "RetroBSD" 2022-07-19 12:21:03 +03:00
Serge Vakulenko
71faeb6c76 Disable mount option in fsutil. No need for libfuse anymore.
Fix build issues in virtualmips simulator.
2022-05-25 16:11:07 -07:00
34 changed files with 336 additions and 81 deletions

5
.gitignore vendored
View File

@@ -26,3 +26,8 @@
*.img
Makefile.user
#misc
*.log
*.txt

View File

@@ -36,7 +36,7 @@ Berkeley YACC, GNU bison, flex, groff, ELF library and FUSE library.
Under Ubuntu, for example, you can do it by command:
```shell
$ sudo apt-get install bison byacc flex groff-base libelf-dev libfuse-dev
$ sudo apt-get install bison byacc flex groff-base libelf-dev
```
You can change a desired filesystem size and swap area size, as required.

View File

@@ -16,7 +16,7 @@
# entries, and in cases where getty is called with no table name
#
default:\
:ap:im=\r\n\r\n2.11 BSD UNIX (%h) (%t)\r\n\r\r\n\r:sp#1200:
:ap:im=\r\n\r\nRetroBSD (%h) (%t)\r\n\r\r\n\r:sp#1200:
#
# Fixed speed entries

View File

@@ -2,7 +2,7 @@ TOPSRC = $(shell cd ..; pwd)
SUBDIR = startup libc libm libcurses libtermlib libwiznet libreadline libgpanel
PROG = ar as aout ld nm ranlib size strip
CFLAGS = -Os -std=gnu89 -fno-builtin -g -Werror -Wall -DCROSS -I. \
CFLAGS = -m32 -Os -std=gnu89 -fno-builtin -g -Wall -DCROSS -I. \
-idirafter $(TOPSRC)/include \
-idirafter $(TOPSRC)/src/cmd/ar \
-idirafter $(TOPSRC)/src/cmd/as
@@ -26,28 +26,28 @@ clean:
for i in $(SUBDIR); do $(MAKE) -C $$i $(MFLAGS) clean; done
ar: $(AR_OBJS)
$(CC) $(LDFLAGS) -o $@ $(AR_OBJS) $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $(AR_OBJS) $(LIBS)
as: as.o
$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $< $(LIBS)
aout: $(AOUT_OBJS)
$(CC) $(LDFLAGS) -o $@ $(AOUT_OBJS) $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $(AOUT_OBJS) $(LIBS)
ld: ld.o
$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $< $(LIBS)
nm: nm.o
$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $< $(LIBS)
ranlib: $(RANLIB_OBJS)
$(CC) $(LDFLAGS) -o $@ $(RANLIB_OBJS) $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $(RANLIB_OBJS) $(LIBS)
size: size.o
$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $< $(LIBS)
strip: strip.o
$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $< $(LIBS)
$(HEADERS):
-ln -s -f ../include/a.out.h .

View File

@@ -262,7 +262,7 @@ bad1: (void)lseek(rfd, (off_t)r_off, SEEK_SET);
void symobj()
{
register RLIB *rp;
char hb[sizeof(struct ar_hdr) + 1 + 64];
char hb[sizeof(struct ar_hdr) + 1];
long ransize, baseoff;
/* Rewind the archive, leaving the magic number. */

View File

@@ -3,19 +3,18 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_start)
/* Required by Microchip C32 linker */
MEMORY
/*MEMORY
{
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 512K
exception_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x1000
kseg0_boot_mem (rx) : ORIGIN = 0x9FC00000, LENGTH = 12K-16
kseg1_boot_mem (rx) : ORIGIN = 0xBFC00000, LENGTH = 0x490
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x80000
kseg0_boot_mem : ORIGIN = 0x9FC00490, LENGTH = 0x970
exception_mem : ORIGIN = 0x9FC01000, LENGTH = 0x1000
kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x490
kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x20000
}
_min_heap_size = 0;
}*/
SECTIONS
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -0,0 +1,91 @@
#
# Makefile for RetroBSD, pic32 target
#
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
#
include ../gcc-config.mk
AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
ifneq (${MIPS_GCC_FORMAT},)
LDFLAGS += -Wl,--oformat=${MIPS_GCC_FORMAT}
endif
# sources are located via $S relative to the compilation directory
S = ../..
DEPFLAGS = -MT $@ -MP -MD -MF .deps/$*.dep
DEFS = -I. ${PARAM} -DKERNEL $(DEPFLAGS)
CFLAGS = -O ${DEFS}
# compile rules: rules are named COMPILE_${SUFFIX}
# SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
COMPILE_C = ${CC} -c ${CFLAGS} $<
COMPILE_S = ${CC} -c ${DEFS} $<
%OBJS
%CFILES
# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
# ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} swapxxx.o
# ${SYSTEM_LD_TAIL}
SYSTEM_OBJ = startup.o ${OBJS} ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
%LOAD
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex
machine:
ln -s .. $@
sys:
ln -s ../../include $@
.deps:
mkdir .deps
startup.o: ../startup.S
${COMPILE_S}
ioconf.o: ioconf.c
${COMPILE_C}
%RULES
ifeq (.deps, $(wildcard .deps))
-include .deps/*.dep
endif

View File

@@ -3,7 +3,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -1,8 +1,77 @@
# PIC32 compiler from UECIDE
# chipKIT PIC32 compiler from UECIDE
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Use UECIDE package from http://uecide.org/download
ifndef MIPS_GCC_PREFIX
ifeq ($(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc,$(wildcard $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc))
MIPS_GCC_PREFIX = $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-
ifdef UECIDE
ifeq ($(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc,$(wildcard $(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc))
MIPS_GCC_PREFIX = $(UECIDE)/compilers/pic32-tools-452/bin/pic32-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
endif
# chipKIT PIC32 compiler on Linux
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download from https://github.com/jasonkajita/chipKIT-cxx/downloads
# and unzip to /usr/local.
# Need to copy pic32-tools/pic32mx/include/stdarg.h
# to pic32-tools/lib/gcc/pic32mx/4.5.1/include.
# MPLABX C32 compiler doesn't support some functionality
# we need, so use chipKIT compiler by default.
ifndef MIPS_GCC_PREFIX
ifeq (/usr/local/pic32-tools/bin/pic32-gcc,$(wildcard /usr/local/pic32-tools/bin/pic32-gcc))
MIPS_GCC_PREFIX = /usr/local/pic32-tools/bin/pic32-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
# Generic MIPS toolchain
# ~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
ifndef MIPS_GCC_PREFIX
ifeq (/usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc,$(wildcard /usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-gcc-4.8.1/bin/mips-elf-
endif
endif
# Generic MIPS toolchain on *BSD
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
# Maybe you can install it from packages one day too.
ifndef MIPS_GCC_PREFIX
ifeq (/usr/local/mips-elf/bin/mips-elf-gcc,$(wildcard /usr/local/mips-elf/bin/mips-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-elf/bin/mips-elf-
endif
endif
# Mentor Sourcery CodeBench Lite toolchain
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ifndef MIPS_GCC_PREFIX
# Download a Linux binary package from
# https://sourcery.mentor.com/GNUToolchain/release2641
ifeq (/usr/local/mips-2013.11/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2013.11/bin/mips-sde-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-2013.11/bin/mips-sde-elf-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
ifndef MIPS_GCC_PREFIX
# Download a Linux binary package from
# https://sourcery.mentor.com/GNUToolchain/release2774
ifeq (/usr/local/mips-2014.05/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2014.05/bin/mips-sde-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-2014.05/bin/mips-sde-elf-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
# Imagination Codescape MIPS SDK Essentials
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download a Linux binary package from:
# http://community.imgtec.com/developers/mips/tools/codescape-mips-sdk/download-codescape-mips-sdk-essentials/
ifndef MIPS_GCC_ROOT
ifeq (/opt/imgtec/Toolchains/mips-mti-elf/2015.01-7,$(wildcard /opt/imgtec/Toolchains/mips-mti-elf/2015.01-7))
MIPS_GCC_ROOT = /opt/imgtec/Toolchains/mips-mti-elf/2015.01-7
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(pic32mx)
OUTPUT_ARCH(mips)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -4,14 +4,75 @@ RELEASE = 0.0
BUILD = $(shell git rev-list HEAD --count)
VERSION = $(RELEASE)-$(BUILD)
# PIC32 compiler from UECIDE
# Use UECIDE package from http://uecide.org/download
# chipKIT PIC32 compiler from UECIDE
ifdef UECIDE
ifndef GCCPREFIX
ifeq ($(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc,$(wildcard $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc))
GCCPREFIX = $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES = -I$(HOME)/.uecide/compilers/pic32-tools/lib/gcc/pic32mx/4.5.2/include
endif
ifeq ($(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc,$(wildcard $(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc))
GCCPREFIX = ${UECIDE}/compilers/pic32-tools-452/bin/pic32-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES = -I${UECIDE}/compilers/pic32-tools-452/lib/gcc/pic32mx/4.5.2/include
endif
endif
endif
# chipKIT PIC32 compiler on Linux
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download from https://github.com/jasonkajita/chipKIT-cxx/downloads
# and unzip to /usr/local.
# Need to copy pic32-tools/pic32mx/include/stdarg.h
# to pic32-tools/lib/gcc/pic32mx/4.5.1/include.
# MPLABX C32 compiler doesn't support some functionality
# we need, so use chipKIT compiler by default.
ifndef GCCPREFIX
ifeq (/usr/local/pic32-tools/bin/pic32-gcc,$(wildcard /usr/local/pic32-tools/bin/pic32-gcc))
GCCPREFIX = /usr/local/pic32-tools/bin/pic32-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES = -I/usr/local/pic32-tools/lib/gcc/pic32mx/4.5.1/include
endif
endif
# Generic MIPS toolchain
# ~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
ifndef GCCPREFIX
ifeq (/usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc,$(wildcard /usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc))
GCCPREFIX = /usr/local/mips-gcc-4.8.1/bin/mips-elf-
LDFLAGS =
INCLUDES =
endif
endif
# Generic MIPS toolchain on *BSD
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
# Maybe you can install it from packages one day too.
ifndef GCCPREFIX
ifeq (/usr/local/mips-elf/bin/mips-elf-gcc,$(wildcard /usr/local/mips-elf/bin/mips-elf-gcc))
GCCPREFIX = /usr/local/mips-elf/bin/mips-elf-
LDFLAGS =
INCLUDES =
endif
endif
# Mentor Sourcery CodeBench Lite toolchain -- DG Downloaded this compiler suite from given link
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can download a Linux or Windows binary package from
# https://sourcery.mentor.com/GNUToolchain/release2641
ifndef GCCPREFIX
ifeq (/usr/local/mips-2013.11/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2013.11/bin/mips-sde-elf-gcc))
GCCPREFIX = /usr/local/mips-2013.11/bin/mips-sde-elf-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES =
endif
endif
ifndef GCCPREFIX
ifeq (/usr/local/mips-2014.05/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2014.05/bin/mips-sde-elf-gcc))
GCCPREFIX = /usr/local/mips-2014.05/bin/mips-sde-elf-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES =
endif
endif
ifndef GCCPREFIX

View File

@@ -3,7 +3,7 @@ BIN = config
SRCS = main.cpp config.cpp mapping.cpp device.cpp cluster.cpp util.cpp core.cpp gstore.cpp
OBJS = main.o config.o mapping.o device.o cluster.o util.o core.o gstore.o
CXX = g++
CXXFLAGS = -Wall -O
CXXFLAGS = -Wall -O -m32
all: .depend $(BIN)

View File

@@ -55,7 +55,7 @@ DEFS += -DLED_KERNEL_PORT=TRISE -DLED_KERNEL_PIN=2 -DLED_KERNEL_INVER
DEFS += -DLED_TTY_PORT=TRISE -DLED_TTY_PIN=3 -DLED_TTY_INVERT
DEPFLAGS = -MT $@ -MD -MP -MF .deps/$*.dep
CFLAGS = -O $(DEFS) $(DEPFLAGS)
CFLAGS = -O $(DEFS) $(DEPFLAGS) -m32
ASFLAGS = $(DEFS) $(DEPFLAGS)
CC = $(GCCPREFIX)gcc -EL -g -mips32r2

View File

@@ -1,5 +1,5 @@
CC = ${HOSTCC}gcc -g
CFLAGS = -O -Wall
CFLAGS = -O -Wall -m32
DESTDIR = /usr/local
OBJS = elf2aout.o
PROG = elf2aout
@@ -15,7 +15,7 @@ clean:
rm -f *~ *.o *.lst *.dis $(PROG)
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(PROG).exe: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

View File

@@ -1,18 +1,25 @@
CC = gcc -g
CFLAGS = -O -Wall
CFLAGS = -O -Wall -m32
DESTDIR = /usr/local
OBJS = fsutil.o superblock.o block.c inode.o create.o check.o \
file.o mount.o manifest.o
PROG = fsutil
# Enable mount option.
#ENABLE_FUSE = 1
# For Mac OS X
ifneq ($(wildcard /usr/local/lib/pkgconfig),)
FUSE_PATH = /usr/local/lib/pkgconfig
endif
# Fuse
MOUNT_CFLAGS = $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --cflags)
LIBS += $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --libs)
ifneq ($(ENABLE_FUSE),)
CFLAGS += -DENABLE_FUSE
MOUNT_CFLAGS = -DFUSE_USE_VERSION=26
MOUNT_CFLAGS += $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --cflags)
LIBS += $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --libs)
endif
all: $(PROG)
@@ -22,7 +29,7 @@ clean:
rm -rf *~ *.o *.lst *.dis $(PROG) $(PROG).dSYM
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
root.bin: $(PROG)
./$(PROG) -n16384 -s2048 $@

View File

@@ -85,7 +85,9 @@ static void print_help (char *progname)
printf (" %s [--verbose] [--partition=n] disk.img\n", progname);
printf (" %s --check [--fix] [--partition=n] disk.img\n", progname);
printf (" %s --new [--size=kbytes | --partition=n] [--manifest=file] disk.img [dir]\n", progname);
#ifdef ENABLE_FUSE
printf (" %s --mount [--partition=n] disk.img dir\n", progname);
#endif
printf (" %s --add [--partition=n] disk.img files...\n", progname);
printf (" %s --extract [--partition=n] disk.img\n", progname);
printf (" %s --repartition=format disk.img\n", progname);
@@ -99,7 +101,9 @@ static void print_help (char *progname)
printf (" -s NUM, --size=NUM Size of filesystem in kbytes.\n");
printf (" -M file, --manifest=file\n");
printf (" List of files and attributes to create.\n");
#ifdef ENABLE_FUSE
printf (" -m, --mount Mount the filesystem.\n");
#endif
printf (" -a, --add Add files to filesystem.\n");
printf (" -x, --extract Extract all files.\n");
printf (" -r format, --repartition=format\n");
@@ -889,7 +893,12 @@ int main (int argc, char **argv)
print_help (argv[0]);
return -1;
}
#ifdef ENABLE_FUSE
return fs_mount(&fs, argv[i+1]);
#else
fprintf (stderr, "fsutil: -m, --mount options are not supported in this version.\n");
return -1;
#endif
}
/* Print the structure of flesystem. */

View File

@@ -27,9 +27,8 @@
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
#include <sys/sysmacros.h>
#define FUSE_USE_VERSION 26
#ifdef ENABLE_FUSE
#include <fuse.h>
#include "bsdfs.h"
@@ -910,3 +909,5 @@ int fs_mount(fs_t *fs, char *dirname)
printf ("\nFilesystem %s unmounted\n", dirname);
return ret;
}
#endif /* ENABLE_FUSE */

View File

@@ -1,4 +1,4 @@
CC = gcc -g
CC = gcc -g -m32
CFLAGS = -O -Wall
DESTDIR = /usr/local
OBJS = ice2aout.o

View File

@@ -1,5 +1,5 @@
CC = gcc -g
CFLAGS = -O -Wall -Werror
CC = gcc -g -m32
CFLAGS = -O -Wall -Werror
YACC = byacc -d
DESTDIR = /usr/local
OBJS = config.o main.o lang.o mkioconf.o mkmakefile.o mkswapconf.o

View File

@@ -166,7 +166,7 @@ extern int do_trace;
extern struct device *dtab;
extern char errbuf[80];
extern char errbuf[];
extern int yyline;
extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;

View File

@@ -99,15 +99,35 @@
* @(#)config.y 8.1 (Berkeley) 6/6/93
*/
#include <sys/sysmacros.h> //definition for major(), minor() and makedev()
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <sys/sysmacros.h>
#include <sys/stat.h>
struct device cur;
struct device *curp = 0;
struct device *dtab;
struct file_list **confp;
struct opt *opt, *mkopt;
struct signal *siglist;
struct cputype *cputype;
char *temp_id;
char *val_id;
char *archname;
char errbuf[80];
char *board;
char *ldscript;
int arch;
int do_trace;
int maxusers;
int yyline;
int dst;
int hadtz;
int zone;
int yylex(void);
int finddev(dev_t dev);

View File

@@ -38,22 +38,8 @@
#include "y.tab.h"
#include "config.h"
int arch;
char *archname;
struct cputype *cputype;
struct opt *opt, *mkopt;
struct signal *siglist;
char *board;
char *ldscript;
int do_trace;
struct device *dtab;
char errbuf[80];
int yyline;
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
int zone, hadtz;
int dst;
struct file_list *conf_list;
int debugging;
int maxusers;
/*
* Config builds a set of files for building a UNIX
@@ -89,7 +75,7 @@ usage: fputs("usage: kconfig [-gp] sysname\n", stderr);
dtab = NULL;
confp = &conf_list;
compp = &comp_list;
//compp = &comp_list;
if (yyparse())
exit(3);

View File

@@ -40,6 +40,8 @@
#include "y.tab.h"
#include "config.h"
struct file_list *ftab;
#define next_word(fp, wd) \
{ register char *word = get_word(fp); \
if (word == (char *)EOF) \
@@ -425,7 +427,7 @@ void makefile()
read_files();
strcpy(line, "../Makefile.kconf");
//strcat(line, archname);
strcat(line, archname);
ifp = fopen(line, "r");
if (ifp == 0) {
perror(line);

View File

@@ -34,11 +34,13 @@
/*
* Build a swap configuration file.
*/
#include <sys/sysmacros.h> //definitions for makedev(), major(), minor()
#include "config.h"
#include <unistd.h>
#include <ctype.h>
#include <sys/sysmacros.h>
void swapconf()
{

View File

@@ -1,5 +1,5 @@
LOBJS=fs.o util.o fops.o set.o
CFLAGS=-Wall -Werror -ggdb3
CFLAGS=-Wall -Werror -ggdb3 -m32
PROGS=umkfs umkdir uls uchmod uchown uchgrp ulogin ucd ucat
POBJS=umkfs.o umkdir.o uls.o uchmod.o uchown.o uchgrp.o ulogin.o ucd.o ucat.o
LDFLAGS=-L. -lufs -ggdb3

View File

@@ -1,11 +1,11 @@
OBJS = mkrd.o
BIN = mkrd
CFLAGS = -Wall -Werror -O
CFLAGS = -m32 -Wall -Werror -O
all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ $< $(LIBS) $(LDFLAGS)
$(CC) -m32 -o $@ $< $(LIBS) $(LDFLAGS)
clean:
@rm -f $(BIN) $(OBJS)

View File

@@ -15,9 +15,12 @@ CFLAGS = -DSIM_PIC32 -DPIC32MX7 -DMAX32
# UBW32 with UART console
#CFLAGS = -DSIM_PIC32 -DPIC32MX7 -DUBW32
CC = gcc -g
CFLAGS += -Wall -Werror -MT $@ -MD -MP -MF .deps/$*.dep -I/opt/local/include -I/opt/local/include/libelf
LIBS = -lpthread -lelf
CC = gcc -g -m32
CFLAGS += -Wall -MT $@ -MD -MP -MF .deps/$*.dep
LIBS = -lpthread
CFLAGS += $(shell pkg-config libelf --cflags)
LIBS += $(shell pkg-config libelf --libs)
ifneq ($(wildcard /usr/lib/librt.a),)
LIBS += -lrt # Linux

View File

@@ -373,7 +373,7 @@ static int load_nand_flash_file (nand_flash_1g_data_t * d)
int i, j = 0;
struct dirent *ent = NULL;
DIR *p_dir;
char file_path[1024];
char file_path[64];
char *file_name;
char block_number[16];
int fd;

View File

@@ -803,12 +803,12 @@ static void vtty_read_and_store (vtty_t * vtty)
vtty->telnet_opt = c;
/* if telnet client can support ttype, ask it to send ttype string */
if ((vtty->telnet_cmd == WILL) && (vtty->telnet_opt == TELOPT_TTYPE)) {
vtty_put_char (vtty, IAC);
vtty_put_char (vtty, SB);
vtty_put_char (vtty, (char)IAC);
vtty_put_char (vtty, (char)SB);
vtty_put_char (vtty, TELOPT_TTYPE);
vtty_put_char (vtty, TELQUAL_SEND);
vtty_put_char (vtty, IAC);
vtty_put_char (vtty, SE);
vtty_put_char (vtty, (char)IAC);
vtty_put_char (vtty, (char)SE);
}
vtty->input_state = VTTY_INPUT_TEXT;
return;