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
23 changed files with 198 additions and 52 deletions

5
.gitignore vendored
View File

@@ -26,3 +26,8 @@
*.img *.img
Makefile.user 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: Under Ubuntu, for example, you can do it by command:
```shell ```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. 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 # entries, and in cases where getty is called with no table name
# #
default:\ 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 # Fixed speed entries

View File

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

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

@@ -56,7 +56,7 @@ ifeq (/usr/local/mips-elf/bin/mips-elf-gcc,$(wildcard /usr/local/mips-elf/bin/mi
endif endif
endif endif
# Mentor Sourcery CodeBench Lite toolchain # Mentor Sourcery CodeBench Lite toolchain -- DG Downloaded this compiler suite from given link
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can download a Linux or Windows binary package from # You can download a Linux or Windows binary package from
# https://sourcery.mentor.com/GNUToolchain/release2641 # https://sourcery.mentor.com/GNUToolchain/release2641

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 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 OBJS = main.o config.o mapping.o device.o cluster.o util.o core.o gstore.o
CXX = g++ CXX = g++
CXXFLAGS = -Wall -O CXXFLAGS = -Wall -O -m32
all: .depend $(BIN) 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 DEFS += -DLED_TTY_PORT=TRISE -DLED_TTY_PIN=3 -DLED_TTY_INVERT
DEPFLAGS = -MT $@ -MD -MP -MF .deps/$*.dep DEPFLAGS = -MT $@ -MD -MP -MF .deps/$*.dep
CFLAGS = -O $(DEFS) $(DEPFLAGS) CFLAGS = -O $(DEFS) $(DEPFLAGS) -m32
ASFLAGS = $(DEFS) $(DEPFLAGS) ASFLAGS = $(DEFS) $(DEPFLAGS)
CC = $(GCCPREFIX)gcc -EL -g -mips32r2 CC = $(GCCPREFIX)gcc -EL -g -mips32r2

View File

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

View File

@@ -1,18 +1,25 @@
CC = gcc -g CC = gcc -g
CFLAGS = -O -Wall CFLAGS = -O -Wall -m32
DESTDIR = /usr/local DESTDIR = /usr/local
OBJS = fsutil.o superblock.o block.c inode.o create.o check.o \ OBJS = fsutil.o superblock.o block.c inode.o create.o check.o \
file.o mount.o manifest.o file.o mount.o manifest.o
PROG = fsutil PROG = fsutil
# Enable mount option.
#ENABLE_FUSE = 1
# For Mac OS X # For Mac OS X
ifneq ($(wildcard /usr/local/lib/pkgconfig),) ifneq ($(wildcard /usr/local/lib/pkgconfig),)
FUSE_PATH = /usr/local/lib/pkgconfig FUSE_PATH = /usr/local/lib/pkgconfig
endif endif
# Fuse # Fuse
MOUNT_CFLAGS = $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --cflags) ifneq ($(ENABLE_FUSE),)
LIBS += $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --libs) 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) all: $(PROG)
@@ -22,7 +29,7 @@ clean:
rm -rf *~ *.o *.lst *.dis $(PROG) $(PROG).dSYM rm -rf *~ *.o *.lst *.dis $(PROG) $(PROG).dSYM
$(PROG): $(OBJS) $(PROG): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(CC) -m32 $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
root.bin: $(PROG) root.bin: $(PROG)
./$(PROG) -n16384 -s2048 $@ ./$(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 [--verbose] [--partition=n] disk.img\n", progname);
printf (" %s --check [--fix] [--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); 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); printf (" %s --mount [--partition=n] disk.img dir\n", progname);
#endif
printf (" %s --add [--partition=n] disk.img files...\n", progname); printf (" %s --add [--partition=n] disk.img files...\n", progname);
printf (" %s --extract [--partition=n] disk.img\n", progname); printf (" %s --extract [--partition=n] disk.img\n", progname);
printf (" %s --repartition=format 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 (" -s NUM, --size=NUM Size of filesystem in kbytes.\n");
printf (" -M file, --manifest=file\n"); printf (" -M file, --manifest=file\n");
printf (" List of files and attributes to create.\n"); printf (" List of files and attributes to create.\n");
#ifdef ENABLE_FUSE
printf (" -m, --mount Mount the filesystem.\n"); printf (" -m, --mount Mount the filesystem.\n");
#endif
printf (" -a, --add Add files to filesystem.\n"); printf (" -a, --add Add files to filesystem.\n");
printf (" -x, --extract Extract all files.\n"); printf (" -x, --extract Extract all files.\n");
printf (" -r format, --repartition=format\n"); printf (" -r format, --repartition=format\n");
@@ -889,7 +893,12 @@ int main (int argc, char **argv)
print_help (argv[0]); print_help (argv[0]);
return -1; return -1;
} }
#ifdef ENABLE_FUSE
return fs_mount(&fs, argv[i+1]); 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. */ /* Print the structure of flesystem. */

View File

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

View File

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

View File

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

View File

@@ -125,15 +125,15 @@ struct config {
/* /*
* Config has a global notion of which architecture is being used. * Config has a global notion of which architecture is being used.
*/ */
int arch; extern int arch;
char *archname; extern char *archname;
#define ARCH_PIC32 1 #define ARCH_PIC32 1
/* /*
* For each architecture, a set of CPU's may be specified as supported. * For each architecture, a set of CPU's may be specified as supported.
* These and the options (below) are put in the C flags in the makefile. * These and the options (below) are put in the C flags in the makefile.
*/ */
struct cputype { extern struct cputype {
char *cpu_name; char *cpu_name;
struct cputype *cpu_next; struct cputype *cpu_next;
} *cputype; } *cputype;
@@ -143,7 +143,7 @@ struct cputype {
* but which may also specify values for the options. * but which may also specify values for the options.
* A separate set of options may be defined for make-style options. * A separate set of options may be defined for make-style options.
*/ */
struct opt { extern struct opt {
char *op_name; char *op_name;
char *op_value; char *op_value;
struct opt *op_next; struct opt *op_next;
@@ -152,30 +152,30 @@ struct opt {
/* /*
* Mapping of signal names to pins. * Mapping of signal names to pins.
*/ */
struct signal { extern struct signal {
char *sig_name; char *sig_name;
int sig_pin; int sig_pin;
int sig_invert; int sig_invert;
struct signal *sig_next; struct signal *sig_next;
} *siglist; } *siglist;
char *board; extern char *board;
char *ldscript; extern char *ldscript;
int do_trace; extern int do_trace;
struct device *dtab; extern struct device *dtab;
char errbuf[80]; extern char errbuf[];
int yyline; extern int yyline;
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp; extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
int zone, hadtz; extern int zone, hadtz;
int dst; extern int dst;
int debugging; extern int debugging;
int maxusers; extern int maxusers;
#define eq(a,b) (!strcmp(a,b)) #define eq(a,b) (!strcmp(a,b))

View File

@@ -99,14 +99,35 @@
* @(#)config.y 8.1 (Berkeley) 6/6/93 * @(#)config.y 8.1 (Berkeley) 6/6/93
*/ */
#include <sys/sysmacros.h> //definition for major(), minor() and makedev()
#include "config.h" #include "config.h"
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h>
struct device cur; struct device cur;
struct device *curp = 0; 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 *temp_id;
char *val_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 yylex(void);
int finddev(dev_t dev); int finddev(dev_t dev);

View File

@@ -38,6 +38,9 @@
#include "y.tab.h" #include "y.tab.h"
#include "config.h" #include "config.h"
struct file_list *conf_list;
int debugging;
/* /*
* Config builds a set of files for building a UNIX * Config builds a set of files for building a UNIX
* system given a description of the desired system. * system given a description of the desired system.
@@ -72,7 +75,7 @@ usage: fputs("usage: kconfig [-gp] sysname\n", stderr);
dtab = NULL; dtab = NULL;
confp = &conf_list; confp = &conf_list;
compp = &comp_list; //compp = &comp_list;
if (yyparse()) if (yyparse())
exit(3); exit(3);

View File

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

View File

@@ -34,6 +34,9 @@
/* /*
* Build a swap configuration file. * Build a swap configuration file.
*/ */
#include <sys/sysmacros.h> //definitions for makedev(), major(), minor()
#include "config.h" #include "config.h"
#include <unistd.h> #include <unistd.h>

View File

@@ -1,5 +1,5 @@
LOBJS=fs.o util.o fops.o set.o 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 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 POBJS=umkfs.o umkdir.o uls.o uchmod.o uchown.o uchgrp.o ulogin.o ucd.o ucat.o
LDFLAGS=-L. -lufs -ggdb3 LDFLAGS=-L. -lufs -ggdb3

View File

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

View File

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

View File

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