Merge branch 'kconfig'.
This commit is contained in:
37
Makefile
37
Makefile
@@ -8,34 +8,6 @@
|
||||
# The `make' will compile everything, including a kernel, utilities
|
||||
# and a root filesystem image.
|
||||
|
||||
#
|
||||
# Supported boards
|
||||
#
|
||||
MAX32 = sys/pic32/max32/MAX32
|
||||
FUBARINO = sys/pic32/fubarino/FUBARINO
|
||||
FUBARINOBIG = sys/pic32/fubarino/FUBARINO-UART2CONS-UART1-SRAMC
|
||||
SDXL = sys/pic32/sdxl/SDXL
|
||||
MAXIMITE = sys/pic32/maximite/MAXIMITE
|
||||
MAXCOLOR = sys/pic32/maximite-color/MAXCOLOR
|
||||
DUINOMITE = sys/pic32/duinomite/DUINOMITE
|
||||
DUINOMITEUART = sys/pic32/duinomite-uart/DUINOMITE-UART
|
||||
DUINOMITEE = sys/pic32/duinomite-e/DUINOMITE-E
|
||||
DUINOMITEEUART = sys/pic32/duinomite-e-uart/DUINOMITE-E-UART
|
||||
PINGUINO = sys/pic32/pinguino-micro/PINGUINO-MICRO
|
||||
MMBMX7 = sys/pic32/mmb-mx7/MMB-MX7
|
||||
WF32 = sys/pic32/wf32/WF32
|
||||
UBW32 = sys/pic32/ubw32/UBW32
|
||||
UBW32UART = sys/pic32/ubw32-uart/UBW32-UART
|
||||
UBW32UARTSDRAM = sys/pic32/ubw32-uart-sdram/UBW32-UART-SDRAM
|
||||
EXPLORER16 = sys/pic32/explorer16/EXPLORER16
|
||||
STARTERKIT = sys/pic32/starter-kit/STARTER-KIT
|
||||
BAREMETAL = sys/pic32/baremetal/BAREMETAL
|
||||
RETROONE = sys/pic32/retroone/RETROONE
|
||||
PINGUINO-MICRO = sys/pic32/pinguino-micro/PINGUINO-MICRO
|
||||
|
||||
# Select target board
|
||||
TARGET ?= $(MAX32)
|
||||
|
||||
# Filesystem and swap sizes.
|
||||
FS_MBYTES = 100
|
||||
U_MBYTES = 100
|
||||
@@ -57,8 +29,6 @@ FSUTIL = tools/fsutil/fsutil
|
||||
|
||||
-include Makefile.user
|
||||
|
||||
TARGETDIR = $(shell dirname $(TARGET))
|
||||
TARGETNAME = $(shell basename $(TARGET))
|
||||
TOPSRC = $(shell pwd)
|
||||
CONFIG = $(TOPSRC)/tools/configsys/config
|
||||
|
||||
@@ -69,11 +39,8 @@ all: .profile
|
||||
$(MAKE) kernel
|
||||
$(MAKE) fs
|
||||
|
||||
kernel: $(TARGETDIR)/Makefile
|
||||
$(MAKE) -C $(TARGETDIR)
|
||||
|
||||
$(TARGETDIR)/Makefile: $(CONFIG) $(TARGETDIR)/$(TARGETNAME)
|
||||
cd $(TARGETDIR) && ../../../tools/configsys/config $(TARGETNAME)
|
||||
kernel: $(CONFIG)
|
||||
$(MAKE) -C sys/pic32 all
|
||||
|
||||
fs: sdcard.img
|
||||
|
||||
|
||||
@@ -8,19 +8,11 @@
|
||||
#define _SYS_EXEC_H_
|
||||
#ifdef KERNEL
|
||||
|
||||
#ifdef EXEC_SCRIPT
|
||||
#define SHSIZE 64
|
||||
#define SHPATHLEN 64
|
||||
#endif
|
||||
#ifdef EXEC_ELF
|
||||
#define STRLEN 32
|
||||
#endif
|
||||
#ifdef EXEC_AOUT
|
||||
#include "exec_aout.h"
|
||||
#endif
|
||||
#ifdef EXEC_ELF
|
||||
#include "exec_elf.h"
|
||||
#endif
|
||||
|
||||
#define NO_ADDR ((caddr_t)(~0U)) /* Indicates addr. not yet filled in */
|
||||
|
||||
@@ -34,29 +26,20 @@ struct exec_params {
|
||||
char **userargp;
|
||||
char **userenvp;
|
||||
union {
|
||||
#ifdef EXEC_SCRIPT
|
||||
char sh[SHSIZE];
|
||||
#endif
|
||||
#ifdef EXEC_AOUT
|
||||
struct exec aout;
|
||||
#endif
|
||||
#ifdef EXEC_ELF
|
||||
struct elf_ehdr elf;
|
||||
#endif
|
||||
} hdr; /* head of file to exec */
|
||||
int hdr_len; /* number of bytes valid in image_header */
|
||||
char **argp, **envp;
|
||||
u_short argc, envc; /* count of argument and environment strings */
|
||||
u_short argbc, envbc; /* total number of chars in argc and envc string pool */
|
||||
union {
|
||||
#ifdef EXEC_SCRIPT
|
||||
struct {
|
||||
char interpname[20]; /* real name of the script interpreter */
|
||||
char interparg[SHPATHLEN]; /* interpreter arg */
|
||||
char interpreted; /* flag - this executable is interpreted */
|
||||
} sh;
|
||||
#endif
|
||||
#ifdef EXEC_ELF
|
||||
struct {
|
||||
struct buf *stbp; /* String table buffer pointer */
|
||||
int stbpos; /* String table pos in buffer */
|
||||
@@ -64,11 +47,8 @@ struct exec_params {
|
||||
int stoffset; /* String table file pos */
|
||||
char str[STRLEN];
|
||||
} elf;
|
||||
#endif
|
||||
#ifdef EXEC_AOUT
|
||||
struct {
|
||||
} aout;
|
||||
#endif
|
||||
};
|
||||
|
||||
gid_t gid;
|
||||
|
||||
@@ -476,13 +476,11 @@ struct elf_args {
|
||||
#include "opt_execfmt.h"
|
||||
#endif
|
||||
|
||||
#ifdef EXEC_ELF
|
||||
int exec_elf_makecmds __P((struct proc *, struct exec_package *));
|
||||
int elf_read_from __P((struct proc *, struct vnode *, u_long,
|
||||
caddr_t, int));
|
||||
void *elf_copyargs __P((struct exec_package *, struct ps_strings *,
|
||||
void *, void *));
|
||||
#endif
|
||||
|
||||
/* common */
|
||||
int exec_elf_setup_stack __P((struct proc *, struct exec_package *));
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
/*
|
||||
* Signals
|
||||
*/
|
||||
#include <signal.h>
|
||||
#include <sys/signal.h>
|
||||
|
||||
#define NBPW sizeof(int) /* number of bytes in an integer */
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
#define MAXHOSTNAMELEN 64
|
||||
|
||||
#if defined(KERNEL) && defined(INET)
|
||||
# include "machine/net_mac.h"
|
||||
# include <machine/net_mac.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* Miscellaneous virtual memory subsystem variables and structures.
|
||||
*
|
||||
* Copyright (c) 1982, 1986 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
@@ -6,20 +8,6 @@
|
||||
* @(#)vmsystm.h 7.2.1 (2.11BSD GTE) 1/15/95
|
||||
*/
|
||||
|
||||
/*
|
||||
* Miscellaneous virtual memory subsystem variables and structures.
|
||||
*/
|
||||
|
||||
#if defined(KERNEL) && defined(UCB_METER) && !defined(SUPERVISOR)
|
||||
size_t freemem; /* remaining clicks of free memory */
|
||||
|
||||
u_short avefree; /* moving average of remaining free clicks */
|
||||
u_short avefree30; /* 30 sec (avefree is 5 sec) moving average */
|
||||
|
||||
/* writable copies of tunables */
|
||||
int maxslp; /* max sleep time before very swappable */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Fork/vfork accounting.
|
||||
*/
|
||||
@@ -31,6 +19,16 @@ struct forkstat
|
||||
long sizvfork;
|
||||
};
|
||||
|
||||
#if defined(KERNEL) && defined(UCB_METER) && !defined(SUPERVISOR)
|
||||
#if defined(KERNEL) && defined(UCB_METER)
|
||||
size_t freemem; /* remaining clicks of free memory */
|
||||
|
||||
u_short avefree; /* moving average of remaining free clicks */
|
||||
u_short avefree30; /* 30 sec (avefree is 5 sec) moving average */
|
||||
|
||||
/*
|
||||
* writable copies of tunables
|
||||
*/
|
||||
int maxslp; /* max sleep time before very swappable */
|
||||
|
||||
struct forkstat forkstat;
|
||||
#endif
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "map.h"
|
||||
#include "inode.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "buf.h"
|
||||
#include "namei.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "file.h"
|
||||
#include "resource.h"
|
||||
#include "exec.h"
|
||||
#include "exec_aout.h"
|
||||
#include "dir.h"
|
||||
#include "uio.h"
|
||||
#include "debug.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/exec_aout.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
int exec_aout_check(struct exec_params *epp)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* $NetBSD: exec_conf.c,v 1.43 2000/06/09 22:38:57 oki Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994 Christopher G. Demetriou
|
||||
* All rights reserved.
|
||||
@@ -29,31 +27,18 @@
|
||||
* (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/param.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/exec.h>
|
||||
|
||||
#include "param.h"
|
||||
#include "inode.h"
|
||||
#include "exec.h"
|
||||
|
||||
#ifdef EXEC_SCRIPT
|
||||
int exec_script_check(struct exec_params *epp);
|
||||
#endif
|
||||
#ifdef EXEC_AOUT
|
||||
int exec_aout_check(struct exec_params *epp);
|
||||
#endif
|
||||
#ifdef EXEC_ELF
|
||||
int exec_elf_check(struct exec_params *epp);
|
||||
#endif
|
||||
|
||||
const struct execsw execsw[] = {
|
||||
#ifdef EXEC_AOUT
|
||||
{ exec_aout_check, "a.out" }, /* a.out binaries */
|
||||
#endif
|
||||
#ifdef EXEC_ELF
|
||||
{ exec_elf_check, "elf" }, /* 32bit ELF bins */
|
||||
#endif
|
||||
#ifdef EXEC_SCRIPT
|
||||
{ exec_script_check, "script" }, /* shell scripts */
|
||||
#endif
|
||||
};
|
||||
int nexecs = (sizeof(execsw) / sizeof(*execsw));
|
||||
int exec_maxhdrsz;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* $NetBSD: exec_elf32.c,v 1.49.2.2 2000/11/03 20:00:38 tv Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@@ -62,22 +60,20 @@
|
||||
* (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 "param.h"
|
||||
#include "systm.h"
|
||||
#include "kernel.h"
|
||||
#include "map.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "inode.h"
|
||||
#include "namei.h"
|
||||
#include "exec.h"
|
||||
#include "exec_elf.h"
|
||||
#include "fcntl.h"
|
||||
#include "signalvar.h"
|
||||
#include "mount.h"
|
||||
#include "stat.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/exec_elf.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
extern char sigcode[], esigcode[];
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "param.h"
|
||||
#include "inode.h"
|
||||
#include "dir.h"
|
||||
#include "namei.h"
|
||||
#include "exec.h"
|
||||
#include "user.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
int
|
||||
exec_script_check(struct exec_params *epp)
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "map.h"
|
||||
#include "inode.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "buf.h"
|
||||
#include "namei.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "file.h"
|
||||
#include "resource.h"
|
||||
#include "exec.h"
|
||||
#include "dir.h"
|
||||
#include "uio.h"
|
||||
#include "debug.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
/*
|
||||
* How memory is set up.
|
||||
@@ -260,13 +260,11 @@ void exec_save_args(struct exec_params *epp)
|
||||
if ((argp = epp->userargp) != NULL)
|
||||
while (argp[argc])
|
||||
argc++;
|
||||
#ifdef EXEC_SCRIPT
|
||||
if (epp->sh.interpreted) {
|
||||
argc++;
|
||||
if (epp->sh.interparg[0])
|
||||
argc++;
|
||||
}
|
||||
#endif
|
||||
if (argc != 0) {
|
||||
if ((epp->argp = (char **)exec_alloc(argc * sizeof(char *), NBPW, epp)) == NULL)
|
||||
return;
|
||||
@@ -283,7 +281,7 @@ void exec_save_args(struct exec_params *epp)
|
||||
ap = *argp++;
|
||||
else
|
||||
ap = NULL;
|
||||
#ifdef EXEC_SCRIPT
|
||||
|
||||
if (epp->sh.interpreted) {
|
||||
if (epp->argc == 0)
|
||||
ap = epp->sh.interpname;
|
||||
@@ -295,7 +293,6 @@ void exec_save_args(struct exec_params *epp)
|
||||
--argp;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (ap == 0)
|
||||
break;
|
||||
l = strlen(ap)+1;
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "map.h"
|
||||
#include "proc.h"
|
||||
#include "ioctl.h"
|
||||
#include "inode.h"
|
||||
#include "conf.h"
|
||||
#include "buf.h"
|
||||
#include "fcntl.h"
|
||||
#include "vm.h"
|
||||
#include "clist.h"
|
||||
#include "reboot.h"
|
||||
#include "systm.h"
|
||||
#include "kernel.h"
|
||||
#include "namei.h"
|
||||
#include "stat.h"
|
||||
#include "rdisk.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/clist.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/rdisk.h>
|
||||
|
||||
u_int swapstart, nswap; /* start and size of swap space */
|
||||
size_t physmem; /* total amount of physical memory */
|
||||
@@ -150,8 +150,11 @@ main()
|
||||
s = spl0();
|
||||
rdisk_init();
|
||||
|
||||
pipedev = rootdev = get_boot_device();
|
||||
swapdev = get_swap_device();
|
||||
if (rootdev == NODEV)
|
||||
rootdev = get_boot_device();
|
||||
if (swapdev == NODEV)
|
||||
swapdev = get_swap_device();
|
||||
pipedev = rootdev;
|
||||
|
||||
/* Mount a root filesystem. */
|
||||
for (;;) {
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "glob.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/glob.h>
|
||||
|
||||
#ifdef INET
|
||||
# define ifnet(narg, name) narg, name
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "callout.h"
|
||||
#include "dk.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/callout.h>
|
||||
#include <sys/dk.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
int noproc; /* no one is running just now */
|
||||
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "file.h"
|
||||
#include "systm.h"
|
||||
#include "inode.h"
|
||||
#include "ioctl.h"
|
||||
#include "stat.h"
|
||||
#include "conf.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/conf.h>
|
||||
#ifdef INET
|
||||
#include "socket.h"
|
||||
#include "socketvar.h"
|
||||
#include <sys/socket.h>
|
||||
#include <sys/socketvar.h>
|
||||
#endif
|
||||
#include <syslog.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
const struct devspec fddevs[] = {
|
||||
{ 0, "stdin" },
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "map.h"
|
||||
#include "inode.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "buf.h"
|
||||
#include "namei.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "file.h"
|
||||
#include "signalvar.h"
|
||||
#include "exec.h"
|
||||
#include "debug.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
/*
|
||||
* exec system call, with and without environments.
|
||||
@@ -66,9 +66,7 @@ int exec_check(struct exec_params *epp)
|
||||
* Read the first 'SHSIZE' bytes from the file to execute
|
||||
*/
|
||||
DEBUG("Read header %d bytes from %d\n", sizeof(epp->hdr), 0);
|
||||
#ifdef EXEC_SCRIPT
|
||||
epp->hdr.sh[0] = '\0'; /* for zero length files */
|
||||
#endif
|
||||
error = rdwri (UIO_READ, epp->ip,
|
||||
(caddr_t) &epp->hdr, sizeof(epp->hdr),
|
||||
(off_t)0, IO_UNIT, &r);
|
||||
@@ -153,4 +151,3 @@ done:
|
||||
if (ip)
|
||||
iput(ip);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "map.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "inode.h"
|
||||
#include "vm.h"
|
||||
#include "file.h"
|
||||
#include "wait.h"
|
||||
#include "kernel.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/kernel.h>
|
||||
|
||||
/*
|
||||
* Notify parent that vfork child is finished with parent's data. Called
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "map.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "inode.h"
|
||||
#include "file.h"
|
||||
#include "vm.h"
|
||||
#include "kernel.h"
|
||||
#include "syslog.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
int mpid; /* generic for unique process id's */
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* byte = rdglob(addr);
|
||||
* success = wrglob(addr,byte);
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
|
||||
#ifndef GLOBSZ
|
||||
#define GLOBSZ 256
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "vm.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
void
|
||||
brk()
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
/*
|
||||
* Is p an inferior of the current process?
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
void
|
||||
getpid()
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
void
|
||||
setuid()
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "systm.h"
|
||||
#include "vm.h"
|
||||
#include "kernel.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
||||
/*
|
||||
* Resource controls and accounting.
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include "inode.h"
|
||||
#include "proc.h"
|
||||
#include "namei.h"
|
||||
#include "signalvar.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/signalvar.h>
|
||||
|
||||
/*
|
||||
* Can the current process send the signal `signum' to process `q'?
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include "buf.h"
|
||||
#include "uio.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
/*
|
||||
* Move data to/from user space.
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "buf.h"
|
||||
#include "signal.h"
|
||||
#include "signalvar.h"
|
||||
#include "vm.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#define SQSIZE 16 /* Must be power of 2 */
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <sys/map.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <machine/cpu.h>
|
||||
#include <conf.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
sysctlfn kern_sysctl;
|
||||
sysctlfn hw_sysctl;
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
static void
|
||||
setthetime (tv)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "buf.h"
|
||||
#include "errno.h"
|
||||
#include "dk.h"
|
||||
#include "debug.h"
|
||||
#include "ioctl.h"
|
||||
#include "rdisk.h"
|
||||
#include "conf.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/dk.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/rdisk.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
#define Q2(X) #X
|
||||
#define QUOTE(X) Q2((X))
|
||||
@@ -32,19 +32,19 @@ extern int sdopen(int unit, int flags, int mode);
|
||||
extern int sdsize(int unit);
|
||||
|
||||
#ifdef SRAMC_ENABLED
|
||||
#include <rd_sramc.h>
|
||||
#include <sys/rd_sramc.h>
|
||||
#endif
|
||||
#ifdef SDRAMP_ENABLED
|
||||
#include <rd_sdramp.h>
|
||||
#include <sys/rd_sdramp.h>
|
||||
#endif
|
||||
#ifdef FLASH_ENABLED
|
||||
#include <rd_flash.h>
|
||||
#include <sys/rd_flash.h>
|
||||
#endif
|
||||
#ifdef MRAMS_ENABLED
|
||||
#include <rd_mrams.h>
|
||||
#include <sys/rd_mrams.h>
|
||||
#endif
|
||||
#ifdef SPIRAMS_ENABLED
|
||||
#include <rd_spirams.h>
|
||||
#include <sys/rd_spirams.h>
|
||||
#endif
|
||||
|
||||
int no_deinit(int u) { return 0; }
|
||||
|
||||
@@ -19,18 +19,18 @@
|
||||
#define NLOG 1
|
||||
int nlog = 1;
|
||||
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "ioctl.h"
|
||||
#include "msgbuf.h"
|
||||
#include "file.h"
|
||||
#include "inode.h"
|
||||
#include "errno.h"
|
||||
#include "uio.h"
|
||||
#include "map.h"
|
||||
#include "systm.h"
|
||||
#include "conf.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/msgbuf.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
const struct devspec logdevs[] = {
|
||||
{ 0, "klog" },
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "buf.h"
|
||||
#include "msgbuf.h"
|
||||
#include "conf.h"
|
||||
#include "ioctl.h"
|
||||
#include "tty.h"
|
||||
#include "reboot.h"
|
||||
#include "systm.h"
|
||||
#include "syslog.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/msgbuf.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
#define TOCONS 0x1
|
||||
#define TOTTY 0x2
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "map.h"
|
||||
#include "vm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/vm.h>
|
||||
|
||||
/*
|
||||
* Resource map handling routines.
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "signalvar.h"
|
||||
#include "inode.h"
|
||||
#include "file.h"
|
||||
#include "ioctl.h"
|
||||
#include "conf.h"
|
||||
#include "uio.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
int selwait;
|
||||
|
||||
@@ -228,7 +228,7 @@ selscan(ibits, obits, nfd, retval)
|
||||
fd_set *ibits, *obits;
|
||||
int nfd, *retval;
|
||||
{
|
||||
register int i, j, flag;
|
||||
register int i, j, flag = 0;
|
||||
fd_mask bits;
|
||||
struct file *fp;
|
||||
int which, n = 0;
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "signalvar.h"
|
||||
#include "inode.h"
|
||||
#include "buf.h"
|
||||
#include "fs.h"
|
||||
#include "file.h"
|
||||
#include "stat.h"
|
||||
#include "mount.h"
|
||||
#include "conf.h"
|
||||
#include "uio.h"
|
||||
#include "ioctl.h"
|
||||
#include "tty.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include "syslog.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
daddr_t rablock; /* block to be read ahead */
|
||||
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "inode.h"
|
||||
#include "file.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "uio.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
int
|
||||
readp (fp, uio, flag)
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "inode.h"
|
||||
#include "vm.h"
|
||||
#include "ptrace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/ptrace.h>
|
||||
|
||||
/*
|
||||
* sys-trace system call.
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "ioctl.h"
|
||||
#include "tty.h"
|
||||
#include "proc.h"
|
||||
#include "file.h"
|
||||
#include "conf.h"
|
||||
#include "dk.h"
|
||||
#include "uio.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include "inode.h"
|
||||
#include "syslog.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/dk.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
static int rts = TIOCM_RTS;
|
||||
|
||||
|
||||
@@ -6,22 +6,22 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "pty.h"
|
||||
#include <sys/pty.h>
|
||||
|
||||
#if NPTY > 0
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "ioctl.h"
|
||||
#include "tty.h"
|
||||
#include "user.h"
|
||||
#include "conf.h"
|
||||
#include "file.h"
|
||||
#include "proc.h"
|
||||
#include "uio.h"
|
||||
#include "kernel.h"
|
||||
#include "inode.h"
|
||||
#include "types.h"
|
||||
#include "ttydev.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ttydev.h>
|
||||
|
||||
const struct devspec ptsdevs[] = {
|
||||
{ 0, "ttyp0" }, { 1, "ttyp1" }, { 2, "ttyp2" }, { 3, "ttyp3" },
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "clist.h"
|
||||
#include "ioctl.h"
|
||||
#include "tty.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/clist.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
char cwaiting;
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
* Indirect driver for controlling tty.
|
||||
*
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "ioctl.h"
|
||||
#include "tty.h"
|
||||
#include "conf.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
const struct devspec sydevs[] = {
|
||||
{ 0, "tty" },
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "fs.h"
|
||||
#include "dir.h"
|
||||
#include "inode.h"
|
||||
#include "buf.h"
|
||||
#include "user.h"
|
||||
#include "kernel.h"
|
||||
#include "mount.h"
|
||||
#include "proc.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
typedef struct fblk *FBLKP;
|
||||
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "buf.h"
|
||||
#include "user.h"
|
||||
#include "conf.h"
|
||||
#include "fs.h"
|
||||
#include "dk.h"
|
||||
#include "systm.h"
|
||||
#include "map.h"
|
||||
#include "proc.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/dk.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
/*
|
||||
* Read in (if necessary) the block and return a buffer pointer.
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "conf.h"
|
||||
#include "dir.h"
|
||||
#include "inode.h"
|
||||
#include "user.h"
|
||||
#include "buf.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "uio.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
/*
|
||||
* Bmap defines the structure of file system storage
|
||||
|
||||
@@ -9,11 +9,10 @@
|
||||
/*
|
||||
* generalized seek sort for disk
|
||||
*/
|
||||
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "buf.h"
|
||||
#include "dk.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/dk.h>
|
||||
|
||||
void
|
||||
disksort (dp, bp)
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "fs.h"
|
||||
#include "inode.h"
|
||||
#include "mount.h"
|
||||
#include "namei.h"
|
||||
#include "systm.h"
|
||||
#include "stat.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/*
|
||||
* Check mode permission on inode pointer.
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "inode.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "kernel.h"
|
||||
#include "buf.h"
|
||||
#include "systm.h"
|
||||
#include "syslog.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
#define INOHSZ 16 /* must be power of two */
|
||||
#define INOHASH(dev,ino) (((dev)+(ino))&(INOHSZ-1))
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include "inode.h"
|
||||
#include "fs.h"
|
||||
#include "buf.h"
|
||||
#include "mount.h"
|
||||
#include "file.h"
|
||||
#include "namei.h"
|
||||
#include "conf.h"
|
||||
#include "stat.h"
|
||||
#include "ioctl.h"
|
||||
#include "proc.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
/*
|
||||
* Common code for mount and umount.
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "dir.h"
|
||||
#include "inode.h"
|
||||
#include "fs.h"
|
||||
#include "mount.h"
|
||||
#include "user.h"
|
||||
#include "buf.h"
|
||||
#include "namei.h"
|
||||
#include "proc.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
int dirchk = 0;
|
||||
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "fs.h"
|
||||
#include "inode.h"
|
||||
#include "buf.h"
|
||||
#include "mount.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
int updlock; /* lock for sync */
|
||||
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include "inode.h"
|
||||
#include "namei.h"
|
||||
#include "fs.h"
|
||||
#include "file.h"
|
||||
#include "stat.h"
|
||||
#include "kernel.h"
|
||||
#include "proc.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
/*
|
||||
* Common routine for chroot and chdir.
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
* ufs_syscalls was getting too large. Various UFS related system calls were
|
||||
* relocated to this file.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "sys/file.h"
|
||||
#include "user.h"
|
||||
#include "inode.h"
|
||||
#include "buf.h"
|
||||
#include "fs.h"
|
||||
#include "namei.h"
|
||||
#include "mount.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include "proc.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/fs.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
static int
|
||||
statfs1 (mp, sbp)
|
||||
|
||||
@@ -41,8 +41,7 @@
|
||||
#include <sys/namei.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "systm.h"
|
||||
#include <sys/systm.h>
|
||||
|
||||
/*
|
||||
* 2.11BSD does not have "vnodes", having instead only old fashioned "inodes".
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "vm.h"
|
||||
#include "kernel.h"
|
||||
#include "systm.h"
|
||||
#include "debug.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
#define MINFINITY -32767 /* minus infinity */
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "map.h"
|
||||
#include "buf.h"
|
||||
#include "systm.h"
|
||||
#include "vm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/vm.h>
|
||||
|
||||
/*
|
||||
* Swap a process in.
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "buf.h"
|
||||
#include "conf.h"
|
||||
#include "systm.h"
|
||||
#include "vm.h"
|
||||
#include "uio.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
/*
|
||||
* swap I/O
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
|
||||
KERNOBJ += adc.o clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o pwm.o rd_sd.o rd_sdramp.o rdisk.o sdram.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o uart.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
|
||||
DEFS += -DADC_ENABLED=YES
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=80000
|
||||
DEFS += -DCONSOLE_DEVICE=tty2
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DGPIO_ENABLED=YES
|
||||
DEFS += -DHZ=1000
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DKERNEL_EXECUTABLE_RAM
|
||||
DEFS += -DLED_DISK_PIN=13
|
||||
DEFS += -DLED_DISK_PORT=TRISC
|
||||
DEFS += -DLED_KERNEL_PIN=15
|
||||
DEFS += -DLED_KERNEL_PORT=TRISA
|
||||
DEFS += -DLED_SWAP_PIN=14
|
||||
DEFS += -DLED_SWAP_PORT=TRISC
|
||||
DEFS += -DLED_TTY_PIN=14
|
||||
DEFS += -DLED_TTY_PORT=TRISA
|
||||
DEFS += -DNMOUNT=3
|
||||
DEFS += -DNPROC=20
|
||||
DEFS += -DPARTITION="sdramp0:sa@2048,fs@14000"
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DPWM_ENABLED=YES
|
||||
DEFS += -DSD0_CS_PIN=3
|
||||
DEFS += -DSD0_CS_PORT=TRISF
|
||||
DEFS += -DSD0_ENA_PIN=13
|
||||
DEFS += -DSD0_ENA_PORT=TRISB
|
||||
DEFS += -DSD0_MHZ=13
|
||||
DEFS += -DSD0_PORT=4
|
||||
DEFS += -DSDRAMP_ENABLED=YES
|
||||
DEFS += -DUART3_BAUD=115200
|
||||
DEFS += -DUART3_ENABLED=YES
|
||||
DEFS += -DUCB_METER
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-sdram.ld
|
||||
|
||||
CONFIG = 32MXSDRAM-UART
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
@@ -7,3 +7,6 @@ unix.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
*.h
|
||||
ioconf.c
|
||||
swapunix.c
|
||||
BIN
sys/pic32/32mxsdram/32mxsdram-schematics.pdf
Normal file
BIN
sys/pic32/32mxsdram/32mxsdram-schematics.pdf
Normal file
Binary file not shown.
79
sys/pic32/32mxsdram/Config
Normal file
79
sys/pic32/32mxsdram/Config
Normal file
@@ -0,0 +1,79 @@
|
||||
#
|
||||
# 32MXSDRAM board PCB v1.0 with UART console
|
||||
# ===========================================
|
||||
# Console on UART3.
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/32mxsdram
|
||||
# kconfig Config
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "CUSTOM_32MXSDRAM" # Board type
|
||||
ldscript "32mxsdram/bootloader.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "HZ=1000" # Rate of timer interrupt
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
options "NPROC=20"
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISA" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=15" # ...use pin RA15
|
||||
options "LED_DISK_PORT=TRISC" # for disk activity LED...
|
||||
options "LED_DISK_PIN=13" # ...use pin RC13
|
||||
options "LED_SWAP_PORT=TRISC" # for swap activity LED...
|
||||
options "LED_SWAP_PIN=14" # ...use pin RC14
|
||||
options "LED_TTY_PORT=TRISA" # for serial activity LED...
|
||||
options "LED_TTY_PIN=14" # ...use pin RA14
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Serial UART ports
|
||||
device uart3
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=tty2" # /dev/tty2
|
||||
|
||||
# SPI ports
|
||||
controller spi4 # SD card
|
||||
|
||||
# sdcard's definition for the SPI port, sdcard's chipselect and high-side power switch
|
||||
# because of a mod on the board we use power=B13, otherwise it shall be D12
|
||||
device sd0 at spi4
|
||||
pins RF3, RB13 # select pin, enable pin
|
||||
options "SD0_MHZ=10" # speed 10 MHz
|
||||
options "SD0_PORT=4" # at spi4 TODO: delete
|
||||
options "SD0_CS_PORT=TRISF" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=3" # ...use pin RF3 TODO: delete
|
||||
options "SD0_ENA_PORT=TRISB" # for microSD enable... TODO: delete
|
||||
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
|
||||
# Use SDRAM driver for the external ramdisk
|
||||
device sdramp0 # SDRAM on external memory bus
|
||||
options "KERNEL_EXECUTABLE_RAM" # allow kernel code in RAM area
|
||||
|
||||
# This defines the swap size and a fs partition size on the external ramdisk.
|
||||
# When the sa@XXXX is larger than the SWAP_KBYTES, the system will use
|
||||
# the swap located on the external ramdisk automatically.
|
||||
# (sd@xxxx + fs@xxxx) <= ramdisk_size
|
||||
options "PARTITION='sdramp0:sa@2048,fs@14000'"
|
||||
options "NMOUNT=3"
|
||||
371
sys/pic32/32mxsdram/Makefile
Normal file
371
sys/pic32/32mxsdram/Makefile
Normal file
@@ -0,0 +1,371 @@
|
||||
PARAM = -DCUSTOM_32MXSDRAM
|
||||
PARAM += -DPIC32MX7
|
||||
PARAM += -DUART3_ENABLED
|
||||
PARAM += -DSPI4_ENABLED
|
||||
PARAM += -DSD_ENABLED
|
||||
PARAM += -DGPIO_ENABLED
|
||||
PARAM += -DADC_ENABLED
|
||||
PARAM += -DPWM_ENABLED
|
||||
PARAM += -DSDRAMP_ENABLED
|
||||
PARAM += -DNMOUNT=3
|
||||
PARAM += -DPARTITION='sdramp0:sa@2048,fs@14000'
|
||||
PARAM += -DKERNEL_EXECUTABLE_RAM
|
||||
PARAM += -DSD0_ENA_PIN=13
|
||||
PARAM += -DSD0_ENA_PORT=TRISB
|
||||
PARAM += -DSD0_CS_PIN=3
|
||||
PARAM += -DSD0_CS_PORT=TRISF
|
||||
PARAM += -DSD0_PORT=4
|
||||
PARAM += -DSD0_MHZ=10
|
||||
PARAM += -DCONSOLE_DEVICE=tty2
|
||||
PARAM += -DLED_TTY_PIN=14
|
||||
PARAM += -DLED_TTY_PORT=TRISA
|
||||
PARAM += -DLED_SWAP_PIN=14
|
||||
PARAM += -DLED_SWAP_PORT=TRISC
|
||||
PARAM += -DLED_DISK_PIN=13
|
||||
PARAM += -DLED_DISK_PORT=TRISC
|
||||
PARAM += -DLED_KERNEL_PIN=15
|
||||
PARAM += -DLED_KERNEL_PORT=TRISA
|
||||
PARAM += -DNPROC=20
|
||||
PARAM += -DBUS_DIV=1
|
||||
PARAM += -DBUS_KHZ=80000
|
||||
PARAM += -DCPU_KHZ=80000
|
||||
PARAM += -DHZ=1000
|
||||
LDSCRIPT = "32mxsdram/bootloader.ld"
|
||||
#
|
||||
# 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 = exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
|
||||
init_main.o init_sysent.o kern_clock.o kern_descrip.o \
|
||||
kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \
|
||||
kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \
|
||||
kern_subr.o kern_synch.o kern_sysctl.o kern_time.o rdisk.o \
|
||||
subr_prf.o subr_rmap.o sys_generic.o sys_inode.o sys_pipe.o \
|
||||
sys_process.o syscalls.o tty.o tty_subr.o tty_tty.o ufs_alloc.o \
|
||||
ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \
|
||||
ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o \
|
||||
ufs_syscalls2.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o adc.o \
|
||||
clock.o cons.o devsw.o exception.o gpio.o machdep.o mem.o pwm.o \
|
||||
rd_sd.o rd_sdramp.o sdram.o signal.o spi.o spi_bus.o swap.o \
|
||||
sysctl.o uart.o
|
||||
|
||||
CFILES = $S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
|
||||
$S/kernel/exec_script.c $S/kernel/exec_subr.c \
|
||||
$S/kernel/init_main.c $S/kernel/init_sysent.c \
|
||||
$S/kernel/kern_clock.c $S/kernel/kern_descrip.c \
|
||||
$S/kernel/kern_exec.c $S/kernel/kern_exit.c \
|
||||
$S/kernel/kern_fork.c $S/kernel/kern_mman.c \
|
||||
$S/kernel/kern_proc.c $S/kernel/kern_prot.c \
|
||||
$S/kernel/kern_prot2.c $S/kernel/kern_resource.c \
|
||||
$S/kernel/kern_sig.c $S/kernel/kern_sig2.c $S/kernel/kern_subr.c \
|
||||
$S/kernel/kern_synch.c $S/kernel/kern_sysctl.c \
|
||||
$S/kernel/kern_time.c $S/kernel/rdisk.c $S/kernel/subr_prf.c \
|
||||
$S/kernel/subr_rmap.c $S/kernel/sys_generic.c \
|
||||
$S/kernel/sys_inode.c $S/kernel/sys_pipe.c \
|
||||
$S/kernel/sys_process.c $S/kernel/syscalls.c $S/kernel/tty.c \
|
||||
$S/kernel/tty_subr.c $S/kernel/tty_tty.c $S/kernel/ufs_alloc.c \
|
||||
$S/kernel/ufs_bio.c $S/kernel/ufs_bmap.c $S/kernel/ufs_dsort.c \
|
||||
$S/kernel/ufs_fio.c $S/kernel/ufs_inode.c $S/kernel/ufs_mount.c \
|
||||
$S/kernel/ufs_namei.c $S/kernel/ufs_subr.c \
|
||||
$S/kernel/ufs_syscalls.c $S/kernel/ufs_syscalls2.c \
|
||||
$S/kernel/vfs_vnops.c $S/kernel/vm_sched.c $S/kernel/vm_swap.c \
|
||||
$S/kernel/vm_swp.c $S/pic32/adc.c $S/pic32/clock.c \
|
||||
$S/pic32/cons.c $S/pic32/devsw.c $S/pic32/exception.c \
|
||||
$S/pic32/gpio.c $S/pic32/machdep.c $S/pic32/mem.c $S/pic32/pwm.c \
|
||||
$S/pic32/rd_sd.c $S/pic32/rd_sdramp.c $S/pic32/signal.c \
|
||||
$S/pic32/spi.c $S/pic32/spi_bus.c $S/pic32/swap.c \
|
||||
$S/pic32/sysctl.c $S/pic32/uart.c swapunix.c
|
||||
|
||||
# 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
|
||||
|
||||
unix: unix.elf
|
||||
|
||||
unix.elf: ${SYSTEM_DEP} swapunix.o
|
||||
${SYSTEM_LD_HEAD}
|
||||
${SYSTEM_LD} swapunix.o
|
||||
${SYSTEM_LD_TAIL}
|
||||
|
||||
swapunix.o: swapunix.c
|
||||
${COMPILE_C}
|
||||
|
||||
all: unix
|
||||
|
||||
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}
|
||||
|
||||
exec_aout.o: $S/kernel/exec_aout.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_conf.o: $S/kernel/exec_conf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_elf.o: $S/kernel/exec_elf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_script.o: $S/kernel/exec_script.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_subr.o: $S/kernel/exec_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_main.o: $S/kernel/init_main.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_sysent.o: $S/kernel/init_sysent.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_clock.o: $S/kernel/kern_clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_descrip.o: $S/kernel/kern_descrip.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exec.o: $S/kernel/kern_exec.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exit.o: $S/kernel/kern_exit.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_fork.o: $S/kernel/kern_fork.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_mman.o: $S/kernel/kern_mman.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_proc.o: $S/kernel/kern_proc.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot.o: $S/kernel/kern_prot.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot2.o: $S/kernel/kern_prot2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_resource.o: $S/kernel/kern_resource.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig.o: $S/kernel/kern_sig.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig2.o: $S/kernel/kern_sig2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_subr.o: $S/kernel/kern_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_synch.o: $S/kernel/kern_synch.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sysctl.o: $S/kernel/kern_sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_time.o: $S/kernel/kern_time.c
|
||||
${COMPILE_C}
|
||||
|
||||
rdisk.o: $S/kernel/rdisk.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_prf.o: $S/kernel/subr_prf.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_rmap.o: $S/kernel/subr_rmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_generic.o: $S/kernel/sys_generic.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_inode.o: $S/kernel/sys_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_pipe.o: $S/kernel/sys_pipe.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_process.o: $S/kernel/sys_process.c
|
||||
${COMPILE_C}
|
||||
|
||||
syscalls.o: $S/kernel/syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty.o: $S/kernel/tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_subr.o: $S/kernel/tty_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_tty.o: $S/kernel/tty_tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_alloc.o: $S/kernel/ufs_alloc.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bio.o: $S/kernel/ufs_bio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bmap.o: $S/kernel/ufs_bmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_dsort.o: $S/kernel/ufs_dsort.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_fio.o: $S/kernel/ufs_fio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_inode.o: $S/kernel/ufs_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_mount.o: $S/kernel/ufs_mount.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_namei.o: $S/kernel/ufs_namei.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_subr.o: $S/kernel/ufs_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
|
||||
${COMPILE_C}
|
||||
|
||||
vfs_vnops.o: $S/kernel/vfs_vnops.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_sched.o: $S/kernel/vm_sched.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swap.o: $S/kernel/vm_swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swp.o: $S/kernel/vm_swp.c
|
||||
${COMPILE_C}
|
||||
|
||||
adc.o: $S/pic32/adc.c
|
||||
${COMPILE_C}
|
||||
|
||||
clock.o: $S/pic32/clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
cons.o: $S/pic32/cons.c
|
||||
${COMPILE_C}
|
||||
|
||||
devsw.o: $S/pic32/devsw.c
|
||||
${COMPILE_C}
|
||||
|
||||
exception.o: $S/pic32/exception.c
|
||||
${COMPILE_C}
|
||||
|
||||
gpio.o: $S/pic32/gpio.c
|
||||
${COMPILE_C}
|
||||
|
||||
machdep.o: $S/pic32/machdep.c
|
||||
${COMPILE_C}
|
||||
|
||||
mem.o: $S/pic32/mem.c
|
||||
${COMPILE_C}
|
||||
|
||||
pwm.o: $S/pic32/pwm.c
|
||||
${COMPILE_C}
|
||||
|
||||
rd_sd.o: $S/pic32/rd_sd.c
|
||||
${COMPILE_C}
|
||||
|
||||
rd_sdramp.o: $S/pic32/rd_sdramp.c
|
||||
${COMPILE_C}
|
||||
|
||||
sdram.o: $S/pic32/sdram.S
|
||||
${COMPILE_S}
|
||||
|
||||
signal.o: $S/pic32/signal.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi.o: $S/pic32/spi.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi_bus.o: $S/pic32/spi_bus.c
|
||||
${COMPILE_C}
|
||||
|
||||
swap.o: $S/pic32/swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sysctl.o: $S/pic32/sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
uart.o: $S/pic32/uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
@@ -14,6 +14,7 @@ MEMORY
|
||||
u0area (rw!x): ORIGIN = 0x800062C0, LENGTH = 3K
|
||||
uarea (rw!x): ORIGIN = 0x80006EC0, LENGTH = 3K
|
||||
keram (rwx) : ORIGIN = 0x80007AC0, LENGTH = 0x540
|
||||
devcfg (r) : ORIGIN = 0x9fc02ff0, LENGTH = 16
|
||||
|
||||
/* Required by Microchip C32 linker */
|
||||
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x80000
|
||||
@@ -46,6 +47,8 @@ SECTIONS
|
||||
*(.glue_7t) *(.glue_7)
|
||||
__rodata_start = . ;
|
||||
*(.rodata .rodata.* .gnu.linkonce.r.* .rel.dyn)
|
||||
__abiflags = . ;
|
||||
*(.MIPS.abiflags)
|
||||
*(.dinit)
|
||||
/* Align here to ensure that the .text section ends on word boundary. */
|
||||
. = ALIGN (32 / 8);
|
||||
@@ -66,6 +69,15 @@ SECTIONS
|
||||
_edata = .;
|
||||
} > ram
|
||||
|
||||
/* Device configuration. */
|
||||
.config :
|
||||
{
|
||||
*(.config3)
|
||||
*(.config2)
|
||||
*(.config1)
|
||||
*(.config0)
|
||||
} > devcfg
|
||||
|
||||
.bss ADDR (.data) + SIZEOF (.data) (NOLOAD) :
|
||||
{
|
||||
__bss_start = .;
|
||||
261
sys/pic32/Config.generic
Normal file
261
sys/pic32/Config.generic
Normal file
@@ -0,0 +1,261 @@
|
||||
#
|
||||
# Generic kernel configuration for PIC32 processor.
|
||||
#
|
||||
# This file contains all the devices and all the options available
|
||||
# for the pic32 platform. It's not expected to be buildable, as some
|
||||
# devices and options are mutually exclusive or incompatible.
|
||||
# It's intended to be used as a reference or as a starting point
|
||||
# when creating configuration for a new board.
|
||||
#
|
||||
# For details, see http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "CHIPKIT_MAX32" # Board type
|
||||
|
||||
# Linker script
|
||||
ldscript "max32/bootloader.ld"
|
||||
|
||||
# Need to set locally
|
||||
timezone 8 dst
|
||||
maxusers 2
|
||||
|
||||
# Standard system options
|
||||
options "HZ=100" # Rate of clock interrupt
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
options "EXEC_AOUT" # Run a.out binaries
|
||||
options "EXEC_ELF" # Run ELF binaries
|
||||
options "EXEC_SCRIPT" # Run shell scripts
|
||||
options "UCB_METER" # Collect kernel statistics
|
||||
options "NPROC=10" # Number of processes, default 10
|
||||
options "NBUF=10" # Number of i/o buffers, default 10
|
||||
options "NFILE=24" # Number of files, default 24
|
||||
options "NINODE=24" # Number of i-nodes, default 24
|
||||
options "NMOUNT=2" # Number of mounted filesystems, default 2
|
||||
options "SMAPSIZ=NPROC" # Size of swap map, default NPROC
|
||||
options "HALTREBOOT" # Reboot the processor on halt()
|
||||
options "KERNEL_HIGHLIGHT" # Highlight kernel messages
|
||||
options "PARTITION='%1'" # Partition schema for RAM device
|
||||
|
||||
# LEDs
|
||||
options "LED_DISK_PORT=TRISF" # for disk activity LED...
|
||||
options "LED_DISK_PIN=0" # ...use pin RF0
|
||||
options "LED_DISK_INVERT" # invert disk LED
|
||||
options "LED_SWAP_PORT=TRISF" # for swap activity LED...
|
||||
options "LED_SWAP_PIN=1" # ...use pin RF1
|
||||
options "LED_SWAP_INVERT" # invert swap LED
|
||||
options "LED_TTY_PORT=TRISA" # for tty LED...
|
||||
options "LED_TTY_PIN=2" # ...use pin RA2
|
||||
options "LED_TTY_INVERT" # invert tty LED
|
||||
options "LED_KERNEL_PORT=TRISA" # for kernel actibity LED...
|
||||
options "LED_KERNEL_PIN=3" # ...use pin RA3
|
||||
options "LED_KERNEL_INVERT" # invert kernel LED
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
dumps on sd0b
|
||||
|
||||
# Serial UART ports
|
||||
device uart1 # Serial-to-USB converter
|
||||
device uart2
|
||||
device uart3
|
||||
device uart4
|
||||
options "UART1_BAUD=115200" # default speed
|
||||
options "UART2_BAUD=115200" # default speed
|
||||
options "UART3_BAUD=115200" # default speed
|
||||
options "UART4_BAUD=115200" # default speed
|
||||
options "UART4_ENA_PORT=TRISB" # to enable power for uart4...
|
||||
options "UART4_ENA_PIN=13" # ...use pin RB13
|
||||
|
||||
# USB UART ports
|
||||
device uartusb # USB device mode, CDC function
|
||||
options "UARTUSB_BAUD=115200" # default speed
|
||||
options "USB_AUTOBOOT=YES" # don't wait for <Enter> on boot
|
||||
options "USB_MAX_EP_NUMBER=3" # parameters of USB device...
|
||||
options "USB_NUM_STRING_DESCRIPTORS=3" # ...specific for CDC function
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=tty0" # /dev/tty0
|
||||
#TODO: options "CONS_MAJOR=17" # use UART device as console
|
||||
#TODO: options "CONS_MINOR=0" # use uart1 unit as console
|
||||
|
||||
# SPI ports
|
||||
controller spi2 # SD card
|
||||
|
||||
# microSD card
|
||||
device sd0 at spi2
|
||||
pins RC14, RA5 # select pin, enable pin
|
||||
options "SD0_MHZ=10" # speed 10 MHz
|
||||
options "SD0_PORT=2" # at spi2 TODO: delete
|
||||
options "SD0_CS_PORT=TRISC" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=14" # ...use pin RC14 TODO: delete
|
||||
options "SD0_ENA_PORT=TRISA" # to enable SD card... TODO: delete
|
||||
options "SD0_ENA_PIN=5" # ...use pin RA5 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio0
|
||||
options "GPIO_CLEAR_PORT=TRISA" # clear on startup...
|
||||
options "GPIO_CLEAR_PIN=5" # ...pin RA5
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
|
||||
# GLCD driver
|
||||
device glcd
|
||||
|
||||
# HX8357 driver
|
||||
device hxtft
|
||||
|
||||
# Skeleton driver
|
||||
device skel
|
||||
|
||||
# Pseudo terminals
|
||||
service pty 4
|
||||
|
||||
# System log
|
||||
service log
|
||||
|
||||
# Power control
|
||||
device power
|
||||
options "POWER_LED_PORT=TRISA" # for power LED...
|
||||
options "POWER_LED_PIN=3" # ...use pin RA3
|
||||
options "POWER_SWITCH_PORT=TRISA" # for power switch...
|
||||
options "POWER_SWITCH_PIN=4" # ...use pin RA4
|
||||
options "POWER_CONTROL_PORT=TRISA" # for power switch...
|
||||
options "POWER_CONTROL_PIN=5" # ...use pin RA5
|
||||
|
||||
#--------------------------------------------
|
||||
# Custom RAM disk devices
|
||||
#
|
||||
|
||||
# sdramp - SDRAM block device
|
||||
device sdramp0 # SDRAM on external memory bus
|
||||
options "KERNEL_EXECUTABLE_RAM" # allow kernel code in RAM area
|
||||
|
||||
# sramc - SRAM block device
|
||||
device sramc0 # SRAM via 4-wire CPLD interface
|
||||
options "SRAMC_DATA_PORT=TRISE" # for DATA signal...
|
||||
options "SRAMC_DATA_PIN=0" # ...use pin RE0
|
||||
options "SRAMC_LDA_PORT=TRISC" # for LDA signal...
|
||||
options "SRAMC_LDA_PIN=13" # ...use pin RC13
|
||||
options "SRAMC_RD_PORT=TRISF" # for RD signal...
|
||||
options "SRAMC_RD_PIN=1" # ...use pin RF1
|
||||
options "SRAMC_WR_PORT=TRISF" # for WR signal...
|
||||
options "SRAMC_WR_PIN=0" # ...use pin RF0
|
||||
|
||||
# picga - SPI block device
|
||||
controller spi1 # RAM disk: picga
|
||||
device picga0 at spi1
|
||||
options "PICGA_BUS=SPI1CON" # TODO: delete this option
|
||||
options "PICGA_CS_PORT=TRISA" # for CS...
|
||||
options "PICGA_CS_PIN=4" # ...use pin RA4
|
||||
|
||||
# mrams - SPI block device
|
||||
controller spi1 # RAM disk: mrams
|
||||
device mrams0 at spi1
|
||||
options "MRAMS_PORT=SPI1CON" # TODO: delete this option
|
||||
options "MRAMS_CHIPS=6" # number of chips
|
||||
options "MRAMS_CHIPSIZE=512" # chip size in kbytes
|
||||
options "MRAMS_MHZ=10" # speed 10 MHz
|
||||
options "MRAMS_CS0_PORT=TRISA" # for CS0...
|
||||
options "MRAMS_CS0_PIN=4" # ...use pin RA4
|
||||
options "MRAMS_CS1_PORT=TRISA" # for CS1...
|
||||
options "MRAMS_CS1_PIN=2" # ...use pin RA2
|
||||
options "MRAMS_CS2_PORT=TRISB" # for CS2...
|
||||
options "MRAMS_CS2_PIN=14" # ...use pin RB14
|
||||
options "MRAMS_CS3_PORT=TRISB" # for CS3...
|
||||
options "MRAMS_CS3_PIN=12" # ...use pin RB12
|
||||
options "MRAMS_CS4_PORT=TRISB" # for CS4...
|
||||
options "MRAMS_CS4_PIN=10" # ...use pin RB10
|
||||
options "MRAMS_CS5_PORT=TRISB" # for CS5...
|
||||
options "MRAMS_CS5_PIN=11" # ...use pin RB11
|
||||
options "MRAMS_LED0_PORT=TRISF" # for LED0...
|
||||
options "MRAMS_LED0_PIN=0" # ...use pin RF0
|
||||
options "MRAMS_LED1_PORT=TRISF" # for LED1...
|
||||
options "MRAMS_LED1_PIN=1" # ...use pin RF1
|
||||
options "MRAMS_LED2_PORT=TRISF" # for LED2...
|
||||
options "MRAMS_LED2_PIN=2" # ...use pin RF2
|
||||
options "MRAMS_LED3_PORT=TRISF" # for LED3...
|
||||
options "MRAMS_LED3_PIN=3" # ...use pin RF3
|
||||
options "MRAMS_LED4_PORT=TRISF" # for LED4...
|
||||
options "MRAMS_LED4_PIN=4" # ...use pin RF4
|
||||
options "MRAMS_LED5_PORT=TRISF" # for LED5...
|
||||
options "MRAMS_LED5_PIN=5" # ...use pin RF5
|
||||
|
||||
# spirams - SPI block device
|
||||
controller spi1 # RAM disk: spirams
|
||||
device spirams0 at spi1
|
||||
options "SPIRAMS_PORT=SPI1CON" # TODO: delete this option
|
||||
options "SPIRAMS_CHIPSIZE=128" # chip size in kbytes
|
||||
options "SPIRAMS_CHIPS=16" # number of chips
|
||||
options "SPIRAMS_MHZ=10" # speed 10 MHz
|
||||
options "SPIRAMS_CS0_PORT=TRISF" # for CS0...
|
||||
options "SPIRAMS_CS0_PIN=0" # ...use pin RF0
|
||||
options "SPIRAMS_CS1_PORT=TRISF" # for CS1...
|
||||
options "SPIRAMS_CS1_PIN=1" # ...use pin RF1
|
||||
options "SPIRAMS_CS2_PORT=TRISF" # for CS2...
|
||||
options "SPIRAMS_CS2_PIN=2" # ...use pin RF2
|
||||
options "SPIRAMS_CS3_PORT=TRISF" # for CS3...
|
||||
options "SPIRAMS_CS3_PIN=3" # ...use pin RF3
|
||||
options "SPIRAMS_CS4_PORT=TRISF" # for CS4...
|
||||
options "SPIRAMS_CS4_PIN=4" # ...use pin RF4
|
||||
options "SPIRAMS_CS5_PORT=TRISF" # for CS5...
|
||||
options "SPIRAMS_CS5_PIN=5" # ...use pin RF5
|
||||
options "SPIRAMS_CS6_PORT=TRISF" # for CS6...
|
||||
options "SPIRAMS_CS6_PIN=6" # ...use pin RF6
|
||||
options "SPIRAMS_CS7_PORT=TRISF" # for CS7...
|
||||
options "SPIRAMS_CS7_PIN=7" # ...use pin RF7
|
||||
options "SPIRAMS_CS8_PORT=TRISF" # for CS8...
|
||||
options "SPIRAMS_CS8_PIN=8" # ...use pin RF8
|
||||
options "SPIRAMS_CS9_PORT=TRISF" # for CS9...
|
||||
options "SPIRAMS_CS9_PIN=9" # ...use pin RF9
|
||||
options "SPIRAMS_CS10_PORT=TRISF" # for CS10...
|
||||
options "SPIRAMS_CS10_PIN=10" # ...use pin RF10
|
||||
options "SPIRAMS_CS11_PORT=TRISF" # for CS11...
|
||||
options "SPIRAMS_CS11_PIN=11" # ...use pin RF11
|
||||
options "SPIRAMS_CS12_PORT=TRISF" # for CS12...
|
||||
options "SPIRAMS_CS12_PIN=12" # ...use pin RF12
|
||||
options "SPIRAMS_CS13_PORT=TRISF" # for CS13...
|
||||
options "SPIRAMS_CS13_PIN=13" # ...use pin RF13
|
||||
options "SPIRAMS_CS14_PORT=TRISF" # for CS14...
|
||||
options "SPIRAMS_CS14_PIN=14" # ...use pin RF14
|
||||
options "SPIRAMS_CS15_PORT=TRISF" # for CS15...
|
||||
options "SPIRAMS_CS15_PIN=15" # ...use pin RF15
|
||||
options "SPIRAMS_LED0_PORT=TRISG" # for LED0...
|
||||
options "SPIRAMS_LED0_PIN=0" # ...use pin RG0
|
||||
options "SPIRAMS_LED1_PORT=TRISG" # for LED1...
|
||||
options "SPIRAMS_LED1_PIN=1" # ...use pin RG1
|
||||
options "SPIRAMS_LED2_PORT=TRISG" # for LED2...
|
||||
options "SPIRAMS_LED2_PIN=2" # ...use pin RG2
|
||||
options "SPIRAMS_LED3_PORT=TRISG" # for LED3...
|
||||
options "SPIRAMS_LED3_PIN=3" # ...use pin RG3
|
||||
options "SPIRAMS_LED4_PORT=TRISG" # for LED4...
|
||||
options "SPIRAMS_LED4_PIN=4" # ...use pin RG4
|
||||
options "SPIRAMS_LED5_PORT=TRISG" # for LED5...
|
||||
options "SPIRAMS_LED5_PIN=5" # ...use pin RG5
|
||||
options "SPIRAMS_LED6_PORT=TRISG" # for LED6...
|
||||
options "SPIRAMS_LED6_PIN=6" # ...use pin RG6
|
||||
options "SPIRAMS_LED7_PORT=TRISG" # for LED7...
|
||||
options "SPIRAMS_LED7_PIN=7" # ...use pin RG7
|
||||
options "SPIRAMS_LED8_PORT=TRISG" # for LED8...
|
||||
options "SPIRAMS_LED8_PIN=8" # ...use pin RG8
|
||||
options "SPIRAMS_LED9_PORT=TRISG" # for LED9...
|
||||
options "SPIRAMS_LED9_PIN=9" # ...use pin RG9
|
||||
options "SPIRAMS_LED10_PORT=TRISG" # for LED10...
|
||||
options "SPIRAMS_LED10_PIN=10" # ...use pin RG10
|
||||
options "SPIRAMS_LED11_PORT=TRISG" # for LED11...
|
||||
options "SPIRAMS_LED11_PIN=11" # ...use pin RG11
|
||||
options "SPIRAMS_LED12_PORT=TRISG" # for LED12...
|
||||
options "SPIRAMS_LED12_PIN=12" # ...use pin RG12
|
||||
options "SPIRAMS_LED13_PORT=TRISG" # for LED13...
|
||||
options "SPIRAMS_LED13_PIN=13" # ...use pin RG13
|
||||
options "SPIRAMS_LED14_PORT=TRISG" # for LED14...
|
||||
options "SPIRAMS_LED14_PIN=14" # ...use pin RG14
|
||||
options "SPIRAMS_LED15_PORT=TRISG" # for LED15...
|
||||
options "SPIRAMS_LED15_PIN=15" # ...use pin RG15
|
||||
@@ -1,11 +1,9 @@
|
||||
|
||||
# Programs that live in subdirectories, and have makefiles of their own.
|
||||
#
|
||||
SUBDIR = baremetal duinomite duinomite-uart duinomite-e \
|
||||
duinomite-e-uart explorer16 max32 maximite \
|
||||
meb starter-kit sdxl ubw32 ubw32-uart \
|
||||
ubw32-uart-sdram baremetal fubarino mmb-mx7 maximite-color \
|
||||
32mxsdram-uart picadillo wf32 pinguino-micro
|
||||
SUBDIR = baremetal duinomite duinomite-emega explorer16 \
|
||||
fubarino max32 maximite maximite-color mmb-mx7 \
|
||||
picadillo pinguino-micro sdxl starter-kit ubw32 wf32
|
||||
|
||||
default:
|
||||
|
||||
@@ -16,9 +14,15 @@ install:
|
||||
|
||||
clean:
|
||||
-for i in $(SUBDIR); do ${MAKE} -C $$i clean; done
|
||||
find .. -name \*~ | xargs rm -f
|
||||
|
||||
clean-all:
|
||||
-for i in $(SUBDIR); do ${MAKE} -C $$i clean-all; done
|
||||
|
||||
reconfig:
|
||||
-for i in $(SUBDIR); do ${MAKE} -C $$i reconfig; done
|
||||
|
||||
configsys:
|
||||
-for i in $(SUBDIR); do echo $$i; \
|
||||
I=`echo $$i | awk '{print toupper($$0)}'`; \
|
||||
(cd $$i; ../../../tools/configsys/config $$I); done
|
||||
if [ ! -f $$i/Config ]; then \
|
||||
(cd $$i; ../../../tools/configsys/config $$I); fi; done
|
||||
|
||||
91
sys/pic32/Makefile.kconf
Normal file
91
sys/pic32/Makefile.kconf
Normal 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
|
||||
@@ -1,22 +1,39 @@
|
||||
Build directories:
|
||||
|
||||
max32 - chipKIT Max32 board.
|
||||
32mxsdram/ - 32MXSDRAM custom board with external SDRAM
|
||||
used as a volatile disk storage (swap).
|
||||
|
||||
ubw32 - Sparkfun UBW32 board, USB console.
|
||||
baremetal/ - PIC32MX processor on a custom board.
|
||||
|
||||
ubw32-uart - Sparkfun UBW32 board, UART console.
|
||||
duinomite/ - Olimex Duinomite or Duinomite-Mega board.
|
||||
|
||||
maximite - Maximite computer.
|
||||
duinomite-emega/ - Olimex Duinomite-eMega board.
|
||||
|
||||
explorer16 - Microchip Explorer 16 board, with
|
||||
PIC32 CAN-USB plug-in module and SD & MMC pictail.
|
||||
explorer16/ - Microchip Explorer 16 board,
|
||||
with PIC32MX plug-in module
|
||||
and SD & MMC pictail.
|
||||
|
||||
starter-kit - Microchip PIC32 USB or Ethernet Starter Kit,
|
||||
with I/O Expansion board and SD & MMC pictail.
|
||||
fubarino/ - Fubarino SD board.
|
||||
|
||||
dip - eflightworks.net PIC32-on-DIP board.
|
||||
(work in progress)
|
||||
max32/ - chipKIT Max32 board.
|
||||
|
||||
meb - Microchip Multimedia Expansion board with
|
||||
Microchip PIC32 USB or Ethernet Starter Kit.
|
||||
(work in progress)
|
||||
maximite/ - Maximite computer.
|
||||
|
||||
maximite-color/ - The Colour Maximite computer.
|
||||
|
||||
mmb-mx7/ - MikroElektronika MultiMedia Board for PIC32MX7.
|
||||
|
||||
picadillo/ - 4D Systems Picadillo-35T board.
|
||||
|
||||
pinguino-micro/ - Olimex Pinguino-Micro board equipped
|
||||
with pic32mx795 processor.
|
||||
|
||||
sdxl/ - Majenko SDXL board.
|
||||
|
||||
starter-kit/ - Microchip PIC32MX USB or Ethernet Starter Kit,
|
||||
with I/O Expansion board and SD & MMC pictail.
|
||||
|
||||
ubw32/ - Sparkfun UBW32 board.
|
||||
|
||||
wf32/ - ChipKIT WF32 board with
|
||||
2.4" LCD TFT display shield.
|
||||
|
||||
@@ -21,15 +21,14 @@
|
||||
* arising out of or in connection with the use or performance of
|
||||
* this software.
|
||||
*/
|
||||
|
||||
#include "param.h"
|
||||
#include "conf.h"
|
||||
#include "user.h"
|
||||
#include "ioctl.h"
|
||||
#include "systm.h"
|
||||
#include "uio.h"
|
||||
#include "adc.h"
|
||||
#include "debug.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/adc.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
const struct devspec adcdevs[] = {
|
||||
{ 0, "adc0" }, { 1, "adc1" }, { 2, "adc2" }, { 3, "adc3" },
|
||||
|
||||
4
sys/pic32/baremetal/.gitignore
vendored
4
sys/pic32/baremetal/.gitignore
vendored
@@ -3,8 +3,10 @@
|
||||
.oldversion
|
||||
machine
|
||||
sys
|
||||
boot.bin
|
||||
unix.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
*.h
|
||||
ioconf.c
|
||||
swapunix.c
|
||||
|
||||
60
sys/pic32/baremetal/Config
Normal file
60
sys/pic32/baremetal/Config
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Custom board with UART console
|
||||
# ==============================
|
||||
# Console on UART1.
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/baremetal
|
||||
# kconfig Config
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "BAREMETAL" # Board type
|
||||
ldscript "baremetal/script.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISD" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=3" # ...use pin RD3
|
||||
options "LED_DISK_PORT=TRISD" # for disk activity LED...
|
||||
options "LED_DISK_PIN=2" # ...use pin RD2
|
||||
options "LED_TTY_PORT=TRISD" # for serial activity LED...
|
||||
options "LED_TTY_PIN=12" # ...use pin RD12
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Serial UART ports
|
||||
device uart1
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=tty0" # /dev/tty0
|
||||
|
||||
# SPI ports
|
||||
controller spi2 # SD card
|
||||
|
||||
# SD card
|
||||
device sd0 at spi2 pin RD1 # select pin
|
||||
options "SD0_MHZ=16" # speed 16 MHz
|
||||
options "SD0_PORT=2" # at spi2 TODO: delete
|
||||
options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=1" # ...use pin RD1 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
@@ -1,45 +1,354 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
PARAM = -DBAREMETAL
|
||||
PARAM += -DPIC32MX7
|
||||
PARAM += -DUART1_ENABLED
|
||||
PARAM += -DSPI2_ENABLED
|
||||
PARAM += -DSD_ENABLED
|
||||
PARAM += -DGPIO_ENABLED
|
||||
PARAM += -DADC_ENABLED
|
||||
PARAM += -DPWM_ENABLED
|
||||
PARAM += -DSD0_CS_PIN=1
|
||||
PARAM += -DSD0_CS_PORT=TRISD
|
||||
PARAM += -DSD0_PORT=2
|
||||
PARAM += -DSD0_MHZ=16
|
||||
PARAM += -DCONSOLE_DEVICE=tty0
|
||||
PARAM += -DLED_TTY_PIN=12
|
||||
PARAM += -DLED_TTY_PORT=TRISD
|
||||
PARAM += -DLED_DISK_PIN=2
|
||||
PARAM += -DLED_DISK_PORT=TRISD
|
||||
PARAM += -DLED_KERNEL_PIN=3
|
||||
PARAM += -DLED_KERNEL_PORT=TRISD
|
||||
PARAM += -DBUS_DIV=1
|
||||
PARAM += -DBUS_KHZ=80000
|
||||
PARAM += -DCPU_KHZ=80000
|
||||
LDSCRIPT = "baremetal/script.ld"
|
||||
#
|
||||
# Makefile for RetroBSD, pic32 target
|
||||
#
|
||||
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
|
||||
#
|
||||
include ../gcc-config.mk
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
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
|
||||
|
||||
KERNOBJ += clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o rd_sd.o rdisk.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o uart.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
ifneq (${MIPS_GCC_FORMAT},)
|
||||
LDFLAGS += -Wl,--oformat=${MIPS_GCC_FORMAT}
|
||||
endif
|
||||
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=80000
|
||||
DEFS += -DCONSOLE_DEVICE=tty0
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DLED_DISK_PIN=2
|
||||
DEFS += -DLED_DISK_PORT=TRISD
|
||||
DEFS += -DLED_KERNEL_PIN=3
|
||||
DEFS += -DLED_KERNEL_PORT=TRISD
|
||||
DEFS += -DLED_TTY_PIN=12
|
||||
DEFS += -DLED_TTY_PORT=TRISD
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DSD0_CS_PIN=1
|
||||
DEFS += -DSD0_CS_PORT=TRISD
|
||||
DEFS += -DSD0_MHZ=16
|
||||
DEFS += -DSD0_PORT=2
|
||||
DEFS += -DUART1_BAUD=115200
|
||||
DEFS += -DUART1_ENABLED=YES
|
||||
DEFS += -DUCB_METER
|
||||
# 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 = exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
|
||||
init_main.o init_sysent.o kern_clock.o kern_descrip.o \
|
||||
kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \
|
||||
kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \
|
||||
kern_subr.o kern_synch.o kern_sysctl.o kern_time.o rdisk.o \
|
||||
subr_prf.o subr_rmap.o sys_generic.o sys_inode.o sys_pipe.o \
|
||||
sys_process.o syscalls.o tty.o tty_subr.o tty_tty.o ufs_alloc.o \
|
||||
ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \
|
||||
ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o \
|
||||
ufs_syscalls2.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o adc.o \
|
||||
clock.o cons.o devsw.o exception.o gpio.o machdep.o mem.o pwm.o \
|
||||
rd_sd.o signal.o spi.o spi_bus.o swap.o sysctl.o uart.o
|
||||
|
||||
CFILES = $S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
|
||||
$S/kernel/exec_script.c $S/kernel/exec_subr.c \
|
||||
$S/kernel/init_main.c $S/kernel/init_sysent.c \
|
||||
$S/kernel/kern_clock.c $S/kernel/kern_descrip.c \
|
||||
$S/kernel/kern_exec.c $S/kernel/kern_exit.c \
|
||||
$S/kernel/kern_fork.c $S/kernel/kern_mman.c \
|
||||
$S/kernel/kern_proc.c $S/kernel/kern_prot.c \
|
||||
$S/kernel/kern_prot2.c $S/kernel/kern_resource.c \
|
||||
$S/kernel/kern_sig.c $S/kernel/kern_sig2.c $S/kernel/kern_subr.c \
|
||||
$S/kernel/kern_synch.c $S/kernel/kern_sysctl.c \
|
||||
$S/kernel/kern_time.c $S/kernel/rdisk.c $S/kernel/subr_prf.c \
|
||||
$S/kernel/subr_rmap.c $S/kernel/sys_generic.c \
|
||||
$S/kernel/sys_inode.c $S/kernel/sys_pipe.c \
|
||||
$S/kernel/sys_process.c $S/kernel/syscalls.c $S/kernel/tty.c \
|
||||
$S/kernel/tty_subr.c $S/kernel/tty_tty.c $S/kernel/ufs_alloc.c \
|
||||
$S/kernel/ufs_bio.c $S/kernel/ufs_bmap.c $S/kernel/ufs_dsort.c \
|
||||
$S/kernel/ufs_fio.c $S/kernel/ufs_inode.c $S/kernel/ufs_mount.c \
|
||||
$S/kernel/ufs_namei.c $S/kernel/ufs_subr.c \
|
||||
$S/kernel/ufs_syscalls.c $S/kernel/ufs_syscalls2.c \
|
||||
$S/kernel/vfs_vnops.c $S/kernel/vm_sched.c $S/kernel/vm_swap.c \
|
||||
$S/kernel/vm_swp.c $S/pic32/adc.c $S/pic32/clock.c \
|
||||
$S/pic32/cons.c $S/pic32/devsw.c $S/pic32/exception.c \
|
||||
$S/pic32/gpio.c $S/pic32/machdep.c $S/pic32/mem.c $S/pic32/pwm.c \
|
||||
$S/pic32/rd_sd.c $S/pic32/signal.c $S/pic32/spi.c \
|
||||
$S/pic32/spi_bus.c $S/pic32/swap.c $S/pic32/sysctl.c \
|
||||
$S/pic32/uart.c swapunix.c
|
||||
|
||||
# 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
|
||||
|
||||
unix: unix.elf
|
||||
|
||||
unix.elf: ${SYSTEM_DEP} swapunix.o
|
||||
${SYSTEM_LD_HEAD}
|
||||
${SYSTEM_LD} swapunix.o
|
||||
${SYSTEM_LD_TAIL}
|
||||
|
||||
swapunix.o: swapunix.c
|
||||
${COMPILE_C}
|
||||
|
||||
all: unix
|
||||
|
||||
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}
|
||||
|
||||
exec_aout.o: $S/kernel/exec_aout.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_conf.o: $S/kernel/exec_conf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_elf.o: $S/kernel/exec_elf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_script.o: $S/kernel/exec_script.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_subr.o: $S/kernel/exec_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_main.o: $S/kernel/init_main.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_sysent.o: $S/kernel/init_sysent.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_clock.o: $S/kernel/kern_clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_descrip.o: $S/kernel/kern_descrip.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exec.o: $S/kernel/kern_exec.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exit.o: $S/kernel/kern_exit.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_fork.o: $S/kernel/kern_fork.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_mman.o: $S/kernel/kern_mman.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_proc.o: $S/kernel/kern_proc.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot.o: $S/kernel/kern_prot.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot2.o: $S/kernel/kern_prot2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_resource.o: $S/kernel/kern_resource.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig.o: $S/kernel/kern_sig.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig2.o: $S/kernel/kern_sig2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_subr.o: $S/kernel/kern_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_synch.o: $S/kernel/kern_synch.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sysctl.o: $S/kernel/kern_sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_time.o: $S/kernel/kern_time.c
|
||||
${COMPILE_C}
|
||||
|
||||
rdisk.o: $S/kernel/rdisk.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_prf.o: $S/kernel/subr_prf.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_rmap.o: $S/kernel/subr_rmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_generic.o: $S/kernel/sys_generic.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_inode.o: $S/kernel/sys_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_pipe.o: $S/kernel/sys_pipe.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_process.o: $S/kernel/sys_process.c
|
||||
${COMPILE_C}
|
||||
|
||||
syscalls.o: $S/kernel/syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty.o: $S/kernel/tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_subr.o: $S/kernel/tty_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_tty.o: $S/kernel/tty_tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_alloc.o: $S/kernel/ufs_alloc.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bio.o: $S/kernel/ufs_bio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bmap.o: $S/kernel/ufs_bmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_dsort.o: $S/kernel/ufs_dsort.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_fio.o: $S/kernel/ufs_fio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_inode.o: $S/kernel/ufs_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_mount.o: $S/kernel/ufs_mount.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_namei.o: $S/kernel/ufs_namei.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_subr.o: $S/kernel/ufs_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
|
||||
${COMPILE_C}
|
||||
|
||||
vfs_vnops.o: $S/kernel/vfs_vnops.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_sched.o: $S/kernel/vm_sched.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swap.o: $S/kernel/vm_swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swp.o: $S/kernel/vm_swp.c
|
||||
${COMPILE_C}
|
||||
|
||||
adc.o: $S/pic32/adc.c
|
||||
${COMPILE_C}
|
||||
|
||||
clock.o: $S/pic32/clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
cons.o: $S/pic32/cons.c
|
||||
${COMPILE_C}
|
||||
|
||||
devsw.o: $S/pic32/devsw.c
|
||||
${COMPILE_C}
|
||||
|
||||
exception.o: $S/pic32/exception.c
|
||||
${COMPILE_C}
|
||||
|
||||
gpio.o: $S/pic32/gpio.c
|
||||
${COMPILE_C}
|
||||
|
||||
machdep.o: $S/pic32/machdep.c
|
||||
${COMPILE_C}
|
||||
|
||||
mem.o: $S/pic32/mem.c
|
||||
${COMPILE_C}
|
||||
|
||||
pwm.o: $S/pic32/pwm.c
|
||||
${COMPILE_C}
|
||||
|
||||
rd_sd.o: $S/pic32/rd_sd.c
|
||||
${COMPILE_C}
|
||||
|
||||
signal.o: $S/pic32/signal.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi.o: $S/pic32/spi.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi_bus.o: $S/pic32/spi_bus.c
|
||||
${COMPILE_C}
|
||||
|
||||
swap.o: $S/pic32/swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sysctl.o: $S/pic32/sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
uart.o: $S/pic32/uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bare.ld
|
||||
|
||||
CONFIG = BAREMETAL
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
|
||||
@@ -7,7 +7,7 @@ PIC32_DEVCFG (
|
||||
DEVCFG0_DEBUG_DISABLED, /* ICE debugger enabled */
|
||||
|
||||
DEVCFG1_FNOSC_FRCDIVPLL | /* Internal FRC oscillator with PLL */
|
||||
DEVCFG1_POSCMOD_DISABLE | /* No crystal */
|
||||
DEVCFG1_POSCMOD_DISABLE | /* No crystal */
|
||||
DEVCFG1_OSCIOFNC | /* CLKO output active */
|
||||
DEVCFG1_FPBDIV_1 | /* Peripheral bus clock = SYSCLK/1 */
|
||||
DEVCFG1_FCKM_DISABLE | /* Fail-safe clock monitor disable */
|
||||
|
||||
@@ -82,6 +82,9 @@ SECTIONS
|
||||
*(.glue_7t) *(.glue_7)
|
||||
__rodata_start = . ;
|
||||
*(.rodata .rodata.* .gnu.linkonce.r.* .rel.dyn)
|
||||
__abiflags = . ;
|
||||
*(.MIPS.abiflags)
|
||||
*(.dinit)
|
||||
/* Align here to ensure that the .text section ends on word boundary. */
|
||||
. = ALIGN (32 / 8);
|
||||
_etext = .;
|
||||
@@ -3,8 +3,8 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "machine/pic32mx.h"
|
||||
#include <sys/param.h>
|
||||
#include <machine/pic32mx.h>
|
||||
|
||||
/*
|
||||
* Setup core timer for `hz' timer interrupts per second.
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "conf.h"
|
||||
#include "user.h"
|
||||
#include "ioctl.h"
|
||||
#include "tty.h"
|
||||
#include "systm.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include "uart.h"
|
||||
#include "usb_uart.h"
|
||||
#include <sys/uart.h>
|
||||
#include <sys/usb_uart.h>
|
||||
|
||||
#define CONCAT(x,y) x ## y
|
||||
#define BBAUD(x) CONCAT(B,x)
|
||||
|
||||
@@ -3,54 +3,52 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "conf.h"
|
||||
#include "buf.h"
|
||||
#include "time.h"
|
||||
#include "ioctl.h"
|
||||
#include "resource.h"
|
||||
#include "inode.h"
|
||||
#include "proc.h"
|
||||
#include "clist.h"
|
||||
#include "tty.h"
|
||||
#include "systm.h"
|
||||
#include "rdisk.h"
|
||||
#include "errno.h"
|
||||
#include "uart.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/clist.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/rdisk.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/uart.h>
|
||||
#include <sys/spi.h>
|
||||
|
||||
#include "swap.h"
|
||||
#include <sys/swap.h>
|
||||
|
||||
extern int strcmp(char *s1, char *s2);
|
||||
|
||||
#ifdef UARTUSB_ENABLED
|
||||
# include "usb_uart.h"
|
||||
# include <sys/usb_uart.h>
|
||||
#endif
|
||||
#ifdef GPIO_ENABLED
|
||||
# include "gpio.h"
|
||||
# include <sys/gpio.h>
|
||||
#endif
|
||||
#ifdef ADC_ENABLED
|
||||
# include "adc.h"
|
||||
#endif
|
||||
#ifdef SPI_ENABLED
|
||||
# include "spi.h"
|
||||
# include <sys/adc.h>
|
||||
#endif
|
||||
#ifdef GLCD_ENABLED
|
||||
# include "glcd.h"
|
||||
# include <sys/glcd.h>
|
||||
#endif
|
||||
#ifdef PWM_ENABLED
|
||||
# include "pwm.h"
|
||||
# include <sys/pwm.h>
|
||||
#endif
|
||||
#ifdef PICGA_ENABLED
|
||||
# include "picga.h"
|
||||
# include <sys/picga.h>
|
||||
#endif
|
||||
#ifdef PTY_ENABLED
|
||||
# include "pty.h"
|
||||
# include <sys/pty.h>
|
||||
#endif
|
||||
#ifdef HX8357_ENABLED
|
||||
# include "hx8357.h"
|
||||
# include <sys/hx8357.h>
|
||||
#endif
|
||||
#ifdef SKEL_ENABLED
|
||||
# include "skel.h"
|
||||
# include <sys/skel.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -215,7 +213,8 @@ const struct cdevsw cdevsw[] = {
|
||||
#endif
|
||||
},
|
||||
{ /* 12 - spi */
|
||||
#ifdef SPI_ENABLED
|
||||
#if defined(SPI1_ENABLED) || defined(SPI2_ENABLED) || \
|
||||
defined(SPI3_ENABLED) || defined(SPI4_ENABLED)
|
||||
spidev_open, spidev_close, spidev_read, spidev_write,
|
||||
spidev_ioctl, nulldev, 0, seltrue,
|
||||
nostrategy, 0, 0, spidevs
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
|
||||
KERNOBJ += clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o rd_sd.o rdisk.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o uart.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=40000
|
||||
DEFS += -DCONSOLE_DEVICE=tty5
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DGPIO_ENABLED=YES
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DLED_DISK_PIN=1
|
||||
DEFS += -DLED_DISK_PORT=TRISC
|
||||
DEFS += -DLED_KERNEL_PIN=15
|
||||
DEFS += -DLED_KERNEL_PORT=TRISB
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DSD0_CS_PIN=12
|
||||
DEFS += -DSD0_CS_PORT=TRISG
|
||||
DEFS += -DSD0_ENA_PIN=13
|
||||
DEFS += -DSD0_ENA_PORT=TRISG
|
||||
DEFS += -DSD0_PORT=3
|
||||
DEFS += -DUART5_BAUD=115200
|
||||
DEFS += -DUART5_ENABLED=YES
|
||||
DEFS += -DUART5_ENA_PIN=13
|
||||
DEFS += -DUART5_ENA_PORT=TRISG
|
||||
DEFS += -DUCB_METER
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-maximite.ld
|
||||
|
||||
CONFIG = DUINOMITE-E-UART
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
9
sys/pic32/duinomite-e/.gitignore
vendored
9
sys/pic32/duinomite-e/.gitignore
vendored
@@ -1,9 +0,0 @@
|
||||
.compileversion
|
||||
.deps/
|
||||
.oldversion
|
||||
machine
|
||||
sys
|
||||
unix.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
@@ -1,46 +0,0 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
|
||||
KERNOBJ += clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o rd_sd.o rdisk.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o usb_device.o usb_function_cdc.o usb_uart.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=40000
|
||||
DEFS += -DCONSOLE_DEVICE=ttyUSB0
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DGPIO_ENABLED=YES
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DLED_DISK_PIN=1
|
||||
DEFS += -DLED_DISK_PORT=TRISC
|
||||
DEFS += -DLED_KERNEL_PIN=15
|
||||
DEFS += -DLED_KERNEL_PORT=TRISB
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DSD0_CS_PIN=12
|
||||
DEFS += -DSD0_CS_PORT=TRISG
|
||||
DEFS += -DSD0_ENA_PIN=13
|
||||
DEFS += -DSD0_ENA_PORT=TRISG
|
||||
DEFS += -DSD0_PORT=3
|
||||
DEFS += -DUARTUSB_ENABLED=YES
|
||||
DEFS += -DUCB_METER
|
||||
DEFS += -DUSB_MAX_EP_NUMBER=3
|
||||
DEFS += -DUSB_NUM_STRING_DESCRIPTORS=3
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-maximite.ld
|
||||
|
||||
CONFIG = DUINOMITE-E
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
@@ -7,3 +7,6 @@ unix.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
*.h
|
||||
ioconf.c
|
||||
swapunix.c
|
||||
64
sys/pic32/duinomite-emega/Config
Normal file
64
sys/pic32/duinomite-emega/Config
Normal file
@@ -0,0 +1,64 @@
|
||||
#
|
||||
# Olimex Duinomite-eMega board
|
||||
# ============================
|
||||
# Console on USB.
|
||||
# For Windows, use the driver: http://www.schmalzhaus.com/UBW32/FW/UBW32inf.zip
|
||||
# For details, see https://github.com/RetroBSD/retrobsd/wiki/Board-Olimex-Duinomite
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/duinomite-emega
|
||||
# kconfig Config
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "DUINOMITE" # Board type
|
||||
ldscript "maximite/bootloader.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=40000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISB" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=15" # ...use pin RB15
|
||||
options "LED_DISK_PORT=TRISC" # for disk activity LED...
|
||||
options "LED_DISK_PIN=1" # ...use pin RC1
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
|
||||
|
||||
# Virtual UART on USB
|
||||
device uartusb
|
||||
options "USB_MAX_EP_NUMBER=3"
|
||||
options "USB_NUM_STRING_DESCRIPTORS=3"
|
||||
|
||||
# SPI ports
|
||||
controller spi3 # SD card
|
||||
|
||||
# microSD card
|
||||
device sd0 at spi3
|
||||
pins RG12, RG13 # select pin, enable pin
|
||||
options "SD0_PORT=3" # at spi3 TODO: delete
|
||||
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=12" # ...use pin RG12 TODO: delete
|
||||
options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: delete
|
||||
options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
64
sys/pic32/duinomite-emega/Config-uart
Normal file
64
sys/pic32/duinomite-emega/Config-uart
Normal file
@@ -0,0 +1,64 @@
|
||||
#
|
||||
# Olimex Duinomite-eMega board
|
||||
# ============================
|
||||
# Console on UART5.
|
||||
# For Windows, use the driver: http://www.schmalzhaus.com/UBW32/FW/UBW32inf.zip
|
||||
# For details, see https://github.com/RetroBSD/retrobsd/wiki/Board-Olimex-Duinomite
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/duinomite-emega
|
||||
# kconfig Config-uart
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "DUINOMITE" # Board type
|
||||
ldscript "maximite/bootloader.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=40000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISB" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=15" # ...use pin RB15
|
||||
options "LED_DISK_PORT=TRISC" # for disk activity LED...
|
||||
options "LED_DISK_PIN=1" # ...use pin RC1
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=tty4" # Console on UART5
|
||||
|
||||
# Serial UART ports
|
||||
device uart5 pin RB13 # RS-232 port, enable pin
|
||||
options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: delete
|
||||
options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: delete
|
||||
|
||||
# SPI ports
|
||||
controller spi3 # SD card
|
||||
|
||||
# microSD card
|
||||
device sd0 at spi3
|
||||
pins RG12, RG13 # select pin, enable pin
|
||||
options "SD0_PORT=3" # at spi3 TODO: delete
|
||||
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=12" # ...use pin RG12 TODO: delete
|
||||
options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: delete
|
||||
options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
363
sys/pic32/duinomite-emega/Makefile
Normal file
363
sys/pic32/duinomite-emega/Makefile
Normal file
@@ -0,0 +1,363 @@
|
||||
PARAM = -DDUINOMITE
|
||||
PARAM += -DPIC32MX7
|
||||
PARAM += -DUARTUSB_ENABLED
|
||||
PARAM += -DSPI3_ENABLED
|
||||
PARAM += -DSD_ENABLED
|
||||
PARAM += -DGPIO_ENABLED
|
||||
PARAM += -DADC_ENABLED
|
||||
PARAM += -DPWM_ENABLED
|
||||
PARAM += -DSD0_ENA_PIN=13
|
||||
PARAM += -DSD0_ENA_PORT=TRISG
|
||||
PARAM += -DSD0_CS_PIN=12
|
||||
PARAM += -DSD0_CS_PORT=TRISG
|
||||
PARAM += -DSD0_PORT=3
|
||||
PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3
|
||||
PARAM += -DUSB_MAX_EP_NUMBER=3
|
||||
PARAM += -DCONSOLE_DEVICE=ttyUSB0
|
||||
PARAM += -DLED_DISK_PIN=1
|
||||
PARAM += -DLED_DISK_PORT=TRISC
|
||||
PARAM += -DLED_KERNEL_PIN=15
|
||||
PARAM += -DLED_KERNEL_PORT=TRISB
|
||||
PARAM += -DBUS_DIV=1
|
||||
PARAM += -DBUS_KHZ=40000
|
||||
PARAM += -DCPU_KHZ=80000
|
||||
LDSCRIPT = "maximite/bootloader.ld"
|
||||
#
|
||||
# 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 = exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
|
||||
init_main.o init_sysent.o kern_clock.o kern_descrip.o \
|
||||
kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \
|
||||
kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \
|
||||
kern_subr.o kern_synch.o kern_sysctl.o kern_time.o rdisk.o \
|
||||
subr_prf.o subr_rmap.o sys_generic.o sys_inode.o sys_pipe.o \
|
||||
sys_process.o syscalls.o tty.o tty_subr.o tty_tty.o ufs_alloc.o \
|
||||
ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \
|
||||
ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o \
|
||||
ufs_syscalls2.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o adc.o \
|
||||
clock.o cons.o devsw.o exception.o gpio.o machdep.o mem.o pwm.o \
|
||||
rd_sd.o signal.o spi.o spi_bus.o swap.o sysctl.o usb_device.o \
|
||||
usb_function_cdc.o usb_uart.o
|
||||
|
||||
CFILES = $S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
|
||||
$S/kernel/exec_script.c $S/kernel/exec_subr.c \
|
||||
$S/kernel/init_main.c $S/kernel/init_sysent.c \
|
||||
$S/kernel/kern_clock.c $S/kernel/kern_descrip.c \
|
||||
$S/kernel/kern_exec.c $S/kernel/kern_exit.c \
|
||||
$S/kernel/kern_fork.c $S/kernel/kern_mman.c \
|
||||
$S/kernel/kern_proc.c $S/kernel/kern_prot.c \
|
||||
$S/kernel/kern_prot2.c $S/kernel/kern_resource.c \
|
||||
$S/kernel/kern_sig.c $S/kernel/kern_sig2.c $S/kernel/kern_subr.c \
|
||||
$S/kernel/kern_synch.c $S/kernel/kern_sysctl.c \
|
||||
$S/kernel/kern_time.c $S/kernel/rdisk.c $S/kernel/subr_prf.c \
|
||||
$S/kernel/subr_rmap.c $S/kernel/sys_generic.c \
|
||||
$S/kernel/sys_inode.c $S/kernel/sys_pipe.c \
|
||||
$S/kernel/sys_process.c $S/kernel/syscalls.c $S/kernel/tty.c \
|
||||
$S/kernel/tty_subr.c $S/kernel/tty_tty.c $S/kernel/ufs_alloc.c \
|
||||
$S/kernel/ufs_bio.c $S/kernel/ufs_bmap.c $S/kernel/ufs_dsort.c \
|
||||
$S/kernel/ufs_fio.c $S/kernel/ufs_inode.c $S/kernel/ufs_mount.c \
|
||||
$S/kernel/ufs_namei.c $S/kernel/ufs_subr.c \
|
||||
$S/kernel/ufs_syscalls.c $S/kernel/ufs_syscalls2.c \
|
||||
$S/kernel/vfs_vnops.c $S/kernel/vm_sched.c $S/kernel/vm_swap.c \
|
||||
$S/kernel/vm_swp.c $S/pic32/adc.c $S/pic32/clock.c \
|
||||
$S/pic32/cons.c $S/pic32/devsw.c $S/pic32/exception.c \
|
||||
$S/pic32/gpio.c $S/pic32/machdep.c $S/pic32/mem.c $S/pic32/pwm.c \
|
||||
$S/pic32/rd_sd.c $S/pic32/signal.c $S/pic32/spi.c \
|
||||
$S/pic32/spi_bus.c $S/pic32/swap.c $S/pic32/sysctl.c \
|
||||
$S/pic32/usb_device.c $S/pic32/usb_function_cdc.c \
|
||||
$S/pic32/usb_uart.c swapunix.c
|
||||
|
||||
# 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
|
||||
|
||||
unix: unix.elf
|
||||
|
||||
unix.elf: ${SYSTEM_DEP} swapunix.o
|
||||
${SYSTEM_LD_HEAD}
|
||||
${SYSTEM_LD} swapunix.o
|
||||
${SYSTEM_LD_TAIL}
|
||||
|
||||
swapunix.o: swapunix.c
|
||||
${COMPILE_C}
|
||||
|
||||
all: unix
|
||||
|
||||
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}
|
||||
|
||||
exec_aout.o: $S/kernel/exec_aout.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_conf.o: $S/kernel/exec_conf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_elf.o: $S/kernel/exec_elf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_script.o: $S/kernel/exec_script.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_subr.o: $S/kernel/exec_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_main.o: $S/kernel/init_main.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_sysent.o: $S/kernel/init_sysent.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_clock.o: $S/kernel/kern_clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_descrip.o: $S/kernel/kern_descrip.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exec.o: $S/kernel/kern_exec.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exit.o: $S/kernel/kern_exit.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_fork.o: $S/kernel/kern_fork.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_mman.o: $S/kernel/kern_mman.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_proc.o: $S/kernel/kern_proc.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot.o: $S/kernel/kern_prot.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot2.o: $S/kernel/kern_prot2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_resource.o: $S/kernel/kern_resource.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig.o: $S/kernel/kern_sig.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig2.o: $S/kernel/kern_sig2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_subr.o: $S/kernel/kern_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_synch.o: $S/kernel/kern_synch.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sysctl.o: $S/kernel/kern_sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_time.o: $S/kernel/kern_time.c
|
||||
${COMPILE_C}
|
||||
|
||||
rdisk.o: $S/kernel/rdisk.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_prf.o: $S/kernel/subr_prf.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_rmap.o: $S/kernel/subr_rmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_generic.o: $S/kernel/sys_generic.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_inode.o: $S/kernel/sys_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_pipe.o: $S/kernel/sys_pipe.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_process.o: $S/kernel/sys_process.c
|
||||
${COMPILE_C}
|
||||
|
||||
syscalls.o: $S/kernel/syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty.o: $S/kernel/tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_subr.o: $S/kernel/tty_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_tty.o: $S/kernel/tty_tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_alloc.o: $S/kernel/ufs_alloc.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bio.o: $S/kernel/ufs_bio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bmap.o: $S/kernel/ufs_bmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_dsort.o: $S/kernel/ufs_dsort.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_fio.o: $S/kernel/ufs_fio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_inode.o: $S/kernel/ufs_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_mount.o: $S/kernel/ufs_mount.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_namei.o: $S/kernel/ufs_namei.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_subr.o: $S/kernel/ufs_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
|
||||
${COMPILE_C}
|
||||
|
||||
vfs_vnops.o: $S/kernel/vfs_vnops.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_sched.o: $S/kernel/vm_sched.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swap.o: $S/kernel/vm_swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swp.o: $S/kernel/vm_swp.c
|
||||
${COMPILE_C}
|
||||
|
||||
adc.o: $S/pic32/adc.c
|
||||
${COMPILE_C}
|
||||
|
||||
clock.o: $S/pic32/clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
cons.o: $S/pic32/cons.c
|
||||
${COMPILE_C}
|
||||
|
||||
devsw.o: $S/pic32/devsw.c
|
||||
${COMPILE_C}
|
||||
|
||||
exception.o: $S/pic32/exception.c
|
||||
${COMPILE_C}
|
||||
|
||||
gpio.o: $S/pic32/gpio.c
|
||||
${COMPILE_C}
|
||||
|
||||
machdep.o: $S/pic32/machdep.c
|
||||
${COMPILE_C}
|
||||
|
||||
mem.o: $S/pic32/mem.c
|
||||
${COMPILE_C}
|
||||
|
||||
pwm.o: $S/pic32/pwm.c
|
||||
${COMPILE_C}
|
||||
|
||||
rd_sd.o: $S/pic32/rd_sd.c
|
||||
${COMPILE_C}
|
||||
|
||||
signal.o: $S/pic32/signal.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi.o: $S/pic32/spi.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi_bus.o: $S/pic32/spi_bus.c
|
||||
${COMPILE_C}
|
||||
|
||||
swap.o: $S/pic32/swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sysctl.o: $S/pic32/sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_device.o: $S/pic32/usb_device.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_function_cdc.o: $S/pic32/usb_function_cdc.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_uart.o: $S/pic32/usb_uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
9
sys/pic32/duinomite-uart/.gitignore
vendored
9
sys/pic32/duinomite-uart/.gitignore
vendored
@@ -1,9 +0,0 @@
|
||||
.compileversion
|
||||
.deps/
|
||||
.oldversion
|
||||
machine
|
||||
sys
|
||||
unix.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
@@ -1,47 +0,0 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
|
||||
KERNOBJ += clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o rd_sd.o rdisk.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o uart.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=80000
|
||||
DEFS += -DCONSOLE_DEVICE=tty4
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DGPIO_ENABLED=YES
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DLED_DISK_PIN=12
|
||||
DEFS += -DLED_DISK_PORT=TRISB
|
||||
DEFS += -DLED_KERNEL_PIN=15
|
||||
DEFS += -DLED_KERNEL_PORT=TRISB
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DSD0_CS_PIN=5
|
||||
DEFS += -DSD0_CS_PORT=TRISD
|
||||
DEFS += -DSD0_ENA_PIN=13
|
||||
DEFS += -DSD0_ENA_PORT=TRISB
|
||||
DEFS += -DSD0_PORT=3
|
||||
DEFS += -DUART5_BAUD=115200
|
||||
DEFS += -DUART5_ENABLED=YES
|
||||
DEFS += -DUART5_ENA_PIN=13
|
||||
DEFS += -DUART5_ENA_PORT=TRISB
|
||||
DEFS += -DUCB_METER
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-maximite.ld
|
||||
|
||||
CONFIG = DUINOMITE-UART
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
3
sys/pic32/duinomite/.gitignore
vendored
3
sys/pic32/duinomite/.gitignore
vendored
@@ -7,3 +7,6 @@ unix.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
*.h
|
||||
ioconf.c
|
||||
swapunix.c
|
||||
|
||||
63
sys/pic32/duinomite/Config
Normal file
63
sys/pic32/duinomite/Config
Normal file
@@ -0,0 +1,63 @@
|
||||
#
|
||||
# Duinomite and Duinomite-Mega boards
|
||||
# ===================================
|
||||
# Console on USB.
|
||||
# For details, see https://github.com/RetroBSD/retrobsd/wiki/Board-Olimex-Duinomite
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/duinomite
|
||||
# kconfig Config
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "DUINOMITE" # Board type
|
||||
ldscript "maximite/bootloader.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISB" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=15" # ...use pin RB15
|
||||
options "LED_DISK_PORT=TRISB" # for disk activity LED...
|
||||
options "LED_DISK_PIN=12" # ...use pin RB12
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
|
||||
|
||||
# Virtual UART on USB
|
||||
device uartusb0
|
||||
options "USB_MAX_EP_NUMBER=3"
|
||||
options "USB_NUM_STRING_DESCRIPTORS=3"
|
||||
|
||||
# SPI ports
|
||||
controller spi3 # SD card
|
||||
|
||||
# microSD card
|
||||
device sd0 at spi3
|
||||
pins RD5, RB13 # select pin, enable pin
|
||||
options "SD0_PORT=3" # at spi3 TODO: delete
|
||||
options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=5" # ...use pin RD5 TODO: delete
|
||||
options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: delete
|
||||
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
63
sys/pic32/duinomite/Config-uart
Normal file
63
sys/pic32/duinomite/Config-uart
Normal file
@@ -0,0 +1,63 @@
|
||||
#
|
||||
# Duinomite and Duinomite-Mega boards
|
||||
# ===================================
|
||||
# Console on UART5.
|
||||
# For details, see https://github.com/RetroBSD/retrobsd/wiki/Board-Olimex-Duinomite
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/duinomite
|
||||
# kconfig Config-uart
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "DUINOMITE" # Board type
|
||||
ldscript "maximite/bootloader.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISB" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=15" # ...use pin RB15
|
||||
options "LED_DISK_PORT=TRISB" # for disk activity LED...
|
||||
options "LED_DISK_PIN=12" # ...use pin RB12
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=tty4" # Console on UART5
|
||||
|
||||
# Serial UART ports
|
||||
device uart5 pin RB13 # RS-232 port, enable pin
|
||||
options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: delete
|
||||
options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: delete
|
||||
|
||||
# SPI ports
|
||||
controller spi3 # SD card
|
||||
|
||||
# microSD card
|
||||
device sd0 at spi3
|
||||
pins RD5, RB13 # select pin, enable pin
|
||||
options "SD0_PORT=3" # at spi3 TODO: delete
|
||||
options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=5" # ...use pin RD5 TODO: delete
|
||||
options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: delete
|
||||
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
@@ -1,48 +1,363 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
PARAM = -DDUINOMITE
|
||||
PARAM += -DPIC32MX7
|
||||
PARAM += -DUARTUSB_ENABLED
|
||||
PARAM += -DSPI3_ENABLED
|
||||
PARAM += -DSD_ENABLED
|
||||
PARAM += -DGPIO_ENABLED
|
||||
PARAM += -DADC_ENABLED
|
||||
PARAM += -DPWM_ENABLED
|
||||
PARAM += -DSD0_ENA_PIN=13
|
||||
PARAM += -DSD0_ENA_PORT=TRISB
|
||||
PARAM += -DSD0_CS_PIN=5
|
||||
PARAM += -DSD0_CS_PORT=TRISD
|
||||
PARAM += -DSD0_PORT=3
|
||||
PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3
|
||||
PARAM += -DUSB_MAX_EP_NUMBER=3
|
||||
PARAM += -DCONSOLE_DEVICE=ttyUSB0
|
||||
PARAM += -DLED_DISK_PIN=12
|
||||
PARAM += -DLED_DISK_PORT=TRISB
|
||||
PARAM += -DLED_KERNEL_PIN=15
|
||||
PARAM += -DLED_KERNEL_PORT=TRISB
|
||||
PARAM += -DBUS_DIV=1
|
||||
PARAM += -DBUS_KHZ=80000
|
||||
PARAM += -DCPU_KHZ=80000
|
||||
LDSCRIPT = "maximite/bootloader.ld"
|
||||
#
|
||||
# Makefile for RetroBSD, pic32 target
|
||||
#
|
||||
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
|
||||
#
|
||||
include ../gcc-config.mk
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
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
|
||||
|
||||
KERNOBJ += adc.o clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o pwm.o rd_sd.o rdisk.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o usb_device.o usb_function_cdc.o usb_uart.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
ifneq (${MIPS_GCC_FORMAT},)
|
||||
LDFLAGS += -Wl,--oformat=${MIPS_GCC_FORMAT}
|
||||
endif
|
||||
|
||||
DEFS += -DADC_ENABLED=YES
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=80000
|
||||
DEFS += -DCONSOLE_DEVICE=ttyUSB0
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DGPIO_ENABLED=YES
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DLED_DISK_PIN=12
|
||||
DEFS += -DLED_DISK_PORT=TRISB
|
||||
DEFS += -DLED_KERNEL_PIN=15
|
||||
DEFS += -DLED_KERNEL_PORT=TRISB
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DPWM_ENABLED=YES
|
||||
DEFS += -DSD0_CS_PIN=5
|
||||
DEFS += -DSD0_CS_PORT=TRISD
|
||||
DEFS += -DSD0_ENA_PIN=13
|
||||
DEFS += -DSD0_ENA_PORT=TRISB
|
||||
DEFS += -DSD0_PORT=3
|
||||
DEFS += -DUARTUSB_ENABLED=YES
|
||||
DEFS += -DUCB_METER
|
||||
DEFS += -DUSB_MAX_EP_NUMBER=3
|
||||
DEFS += -DUSB_NUM_STRING_DESCRIPTORS=3
|
||||
# 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 = exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
|
||||
init_main.o init_sysent.o kern_clock.o kern_descrip.o \
|
||||
kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \
|
||||
kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \
|
||||
kern_subr.o kern_synch.o kern_sysctl.o kern_time.o rdisk.o \
|
||||
subr_prf.o subr_rmap.o sys_generic.o sys_inode.o sys_pipe.o \
|
||||
sys_process.o syscalls.o tty.o tty_subr.o tty_tty.o ufs_alloc.o \
|
||||
ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \
|
||||
ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o \
|
||||
ufs_syscalls2.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o adc.o \
|
||||
clock.o cons.o devsw.o exception.o gpio.o machdep.o mem.o pwm.o \
|
||||
rd_sd.o signal.o spi.o spi_bus.o swap.o sysctl.o usb_device.o \
|
||||
usb_function_cdc.o usb_uart.o
|
||||
|
||||
CFILES = $S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
|
||||
$S/kernel/exec_script.c $S/kernel/exec_subr.c \
|
||||
$S/kernel/init_main.c $S/kernel/init_sysent.c \
|
||||
$S/kernel/kern_clock.c $S/kernel/kern_descrip.c \
|
||||
$S/kernel/kern_exec.c $S/kernel/kern_exit.c \
|
||||
$S/kernel/kern_fork.c $S/kernel/kern_mman.c \
|
||||
$S/kernel/kern_proc.c $S/kernel/kern_prot.c \
|
||||
$S/kernel/kern_prot2.c $S/kernel/kern_resource.c \
|
||||
$S/kernel/kern_sig.c $S/kernel/kern_sig2.c $S/kernel/kern_subr.c \
|
||||
$S/kernel/kern_synch.c $S/kernel/kern_sysctl.c \
|
||||
$S/kernel/kern_time.c $S/kernel/rdisk.c $S/kernel/subr_prf.c \
|
||||
$S/kernel/subr_rmap.c $S/kernel/sys_generic.c \
|
||||
$S/kernel/sys_inode.c $S/kernel/sys_pipe.c \
|
||||
$S/kernel/sys_process.c $S/kernel/syscalls.c $S/kernel/tty.c \
|
||||
$S/kernel/tty_subr.c $S/kernel/tty_tty.c $S/kernel/ufs_alloc.c \
|
||||
$S/kernel/ufs_bio.c $S/kernel/ufs_bmap.c $S/kernel/ufs_dsort.c \
|
||||
$S/kernel/ufs_fio.c $S/kernel/ufs_inode.c $S/kernel/ufs_mount.c \
|
||||
$S/kernel/ufs_namei.c $S/kernel/ufs_subr.c \
|
||||
$S/kernel/ufs_syscalls.c $S/kernel/ufs_syscalls2.c \
|
||||
$S/kernel/vfs_vnops.c $S/kernel/vm_sched.c $S/kernel/vm_swap.c \
|
||||
$S/kernel/vm_swp.c $S/pic32/adc.c $S/pic32/clock.c \
|
||||
$S/pic32/cons.c $S/pic32/devsw.c $S/pic32/exception.c \
|
||||
$S/pic32/gpio.c $S/pic32/machdep.c $S/pic32/mem.c $S/pic32/pwm.c \
|
||||
$S/pic32/rd_sd.c $S/pic32/signal.c $S/pic32/spi.c \
|
||||
$S/pic32/spi_bus.c $S/pic32/swap.c $S/pic32/sysctl.c \
|
||||
$S/pic32/usb_device.c $S/pic32/usb_function_cdc.c \
|
||||
$S/pic32/usb_uart.c swapunix.c
|
||||
|
||||
# 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
|
||||
|
||||
unix: unix.elf
|
||||
|
||||
unix.elf: ${SYSTEM_DEP} swapunix.o
|
||||
${SYSTEM_LD_HEAD}
|
||||
${SYSTEM_LD} swapunix.o
|
||||
${SYSTEM_LD_TAIL}
|
||||
|
||||
swapunix.o: swapunix.c
|
||||
${COMPILE_C}
|
||||
|
||||
all: unix
|
||||
|
||||
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}
|
||||
|
||||
exec_aout.o: $S/kernel/exec_aout.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_conf.o: $S/kernel/exec_conf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_elf.o: $S/kernel/exec_elf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_script.o: $S/kernel/exec_script.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_subr.o: $S/kernel/exec_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_main.o: $S/kernel/init_main.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_sysent.o: $S/kernel/init_sysent.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_clock.o: $S/kernel/kern_clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_descrip.o: $S/kernel/kern_descrip.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exec.o: $S/kernel/kern_exec.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exit.o: $S/kernel/kern_exit.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_fork.o: $S/kernel/kern_fork.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_mman.o: $S/kernel/kern_mman.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_proc.o: $S/kernel/kern_proc.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot.o: $S/kernel/kern_prot.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot2.o: $S/kernel/kern_prot2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_resource.o: $S/kernel/kern_resource.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig.o: $S/kernel/kern_sig.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig2.o: $S/kernel/kern_sig2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_subr.o: $S/kernel/kern_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_synch.o: $S/kernel/kern_synch.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sysctl.o: $S/kernel/kern_sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_time.o: $S/kernel/kern_time.c
|
||||
${COMPILE_C}
|
||||
|
||||
rdisk.o: $S/kernel/rdisk.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_prf.o: $S/kernel/subr_prf.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_rmap.o: $S/kernel/subr_rmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_generic.o: $S/kernel/sys_generic.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_inode.o: $S/kernel/sys_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_pipe.o: $S/kernel/sys_pipe.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_process.o: $S/kernel/sys_process.c
|
||||
${COMPILE_C}
|
||||
|
||||
syscalls.o: $S/kernel/syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty.o: $S/kernel/tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_subr.o: $S/kernel/tty_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_tty.o: $S/kernel/tty_tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_alloc.o: $S/kernel/ufs_alloc.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bio.o: $S/kernel/ufs_bio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bmap.o: $S/kernel/ufs_bmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_dsort.o: $S/kernel/ufs_dsort.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_fio.o: $S/kernel/ufs_fio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_inode.o: $S/kernel/ufs_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_mount.o: $S/kernel/ufs_mount.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_namei.o: $S/kernel/ufs_namei.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_subr.o: $S/kernel/ufs_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
|
||||
${COMPILE_C}
|
||||
|
||||
vfs_vnops.o: $S/kernel/vfs_vnops.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_sched.o: $S/kernel/vm_sched.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swap.o: $S/kernel/vm_swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swp.o: $S/kernel/vm_swp.c
|
||||
${COMPILE_C}
|
||||
|
||||
adc.o: $S/pic32/adc.c
|
||||
${COMPILE_C}
|
||||
|
||||
clock.o: $S/pic32/clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
cons.o: $S/pic32/cons.c
|
||||
${COMPILE_C}
|
||||
|
||||
devsw.o: $S/pic32/devsw.c
|
||||
${COMPILE_C}
|
||||
|
||||
exception.o: $S/pic32/exception.c
|
||||
${COMPILE_C}
|
||||
|
||||
gpio.o: $S/pic32/gpio.c
|
||||
${COMPILE_C}
|
||||
|
||||
machdep.o: $S/pic32/machdep.c
|
||||
${COMPILE_C}
|
||||
|
||||
mem.o: $S/pic32/mem.c
|
||||
${COMPILE_C}
|
||||
|
||||
pwm.o: $S/pic32/pwm.c
|
||||
${COMPILE_C}
|
||||
|
||||
rd_sd.o: $S/pic32/rd_sd.c
|
||||
${COMPILE_C}
|
||||
|
||||
signal.o: $S/pic32/signal.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi.o: $S/pic32/spi.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi_bus.o: $S/pic32/spi_bus.c
|
||||
${COMPILE_C}
|
||||
|
||||
swap.o: $S/pic32/swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sysctl.o: $S/pic32/sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_device.o: $S/pic32/usb_device.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_function_cdc.o: $S/pic32/usb_function_cdc.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_uart.o: $S/pic32/usb_uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-maximite.ld
|
||||
|
||||
CONFIG = DUINOMITE
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "signalvar.h"
|
||||
#include "systm.h"
|
||||
#include "user.h"
|
||||
#include "proc.h"
|
||||
#include "vm.h"
|
||||
#include "uart.h"
|
||||
#include "usb_uart.h"
|
||||
#include "debug.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/uart.h>
|
||||
#include <sys/usb_uart.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
//#define TRACE_EXCEPTIONS
|
||||
|
||||
|
||||
4
sys/pic32/explorer16/.gitignore
vendored
4
sys/pic32/explorer16/.gitignore
vendored
@@ -4,7 +4,9 @@
|
||||
machine
|
||||
sys
|
||||
unix.bin
|
||||
boot.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
*.h
|
||||
ioconf.c
|
||||
swapunix.c
|
||||
|
||||
62
sys/pic32/explorer16/Config
Normal file
62
sys/pic32/explorer16/Config
Normal file
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# Microchip Explorer16 board with SD card expansion module
|
||||
# ========================================================
|
||||
# Console on UART2.
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/explorer16
|
||||
# kconfig Config
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "EXPLORER16" # Board type
|
||||
ldscript "baremetal/script.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
# LED
|
||||
options "LED_DISK_PORT=TRISA" # for disk activity LED...
|
||||
options "LED_DISK_PIN=0" # ...use pin RA0
|
||||
options "LED_KERNEL_PORT=TRISA" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=1" # ...use pin RA1
|
||||
options "LED_TTY_PORT=TRISA" # for serial activity LED...
|
||||
options "LED_TTY_PIN=2" # ...use pin RA2
|
||||
options "LED_SWAP_PORT=TRISA" # for swap activity LED...
|
||||
options "LED_SWAP_PIN=3" # ...use pin RA3
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Serial UART ports
|
||||
device uart2
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=tty1" # /dev/tty1
|
||||
|
||||
# SPI ports
|
||||
controller spi1 # SD card
|
||||
|
||||
# SD card
|
||||
device sd0 at spi1 pin RB1 # select pin
|
||||
options "SD0_MHZ=10" # speed 10 MHz
|
||||
options "SD0_PORT=1" # at spi1 TODO: delete
|
||||
options "SD0_CS_PORT=TRISB" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=1" # ...use pin RB1 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
@@ -1,48 +1,356 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
PARAM = -DEXPLORER16
|
||||
PARAM += -DPIC32MX7
|
||||
PARAM += -DUART2_ENABLED
|
||||
PARAM += -DSPI1_ENABLED
|
||||
PARAM += -DSD_ENABLED
|
||||
PARAM += -DGPIO_ENABLED
|
||||
PARAM += -DADC_ENABLED
|
||||
PARAM += -DPWM_ENABLED
|
||||
PARAM += -DSD0_CS_PIN=1
|
||||
PARAM += -DSD0_CS_PORT=TRISB
|
||||
PARAM += -DSD0_PORT=1
|
||||
PARAM += -DSD0_MHZ=10
|
||||
PARAM += -DCONSOLE_DEVICE=tty1
|
||||
PARAM += -DLED_SWAP_PIN=3
|
||||
PARAM += -DLED_SWAP_PORT=TRISA
|
||||
PARAM += -DLED_TTY_PIN=2
|
||||
PARAM += -DLED_TTY_PORT=TRISA
|
||||
PARAM += -DLED_KERNEL_PIN=1
|
||||
PARAM += -DLED_KERNEL_PORT=TRISA
|
||||
PARAM += -DLED_DISK_PIN=0
|
||||
PARAM += -DLED_DISK_PORT=TRISA
|
||||
PARAM += -DBUS_DIV=1
|
||||
PARAM += -DBUS_KHZ=80000
|
||||
PARAM += -DCPU_KHZ=80000
|
||||
LDSCRIPT = "baremetal/script.ld"
|
||||
#
|
||||
# Makefile for RetroBSD, pic32 target
|
||||
#
|
||||
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
|
||||
#
|
||||
include ../gcc-config.mk
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
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
|
||||
|
||||
KERNOBJ += clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o rd_sd.o rdisk.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o uart.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
ifneq (${MIPS_GCC_FORMAT},)
|
||||
LDFLAGS += -Wl,--oformat=${MIPS_GCC_FORMAT}
|
||||
endif
|
||||
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=80000
|
||||
DEFS += -DCONSOLE_DEVICE=tty1
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DGPIO_ENABLED=YES
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DLED_DISK_PIN=0
|
||||
DEFS += -DLED_DISK_PORT=TRISA
|
||||
DEFS += -DLED_KERNEL_PIN=1
|
||||
DEFS += -DLED_KERNEL_PORT=TRISA
|
||||
DEFS += -DLED_SWAP_PIN=3
|
||||
DEFS += -DLED_SWAP_PORT=TRISA
|
||||
DEFS += -DLED_TTY_PIN=2
|
||||
DEFS += -DLED_TTY_PORT=TRISA
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DSD0_CS_PIN=1
|
||||
DEFS += -DSD0_CS_PORT=TRISB
|
||||
DEFS += -DSD0_MHZ=10
|
||||
DEFS += -DSD0_PORT=1
|
||||
DEFS += -DUART2_BAUD=115200
|
||||
DEFS += -DUART2_ENABLED=YES
|
||||
DEFS += -DUCB_METER
|
||||
# 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 = exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
|
||||
init_main.o init_sysent.o kern_clock.o kern_descrip.o \
|
||||
kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \
|
||||
kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \
|
||||
kern_subr.o kern_synch.o kern_sysctl.o kern_time.o rdisk.o \
|
||||
subr_prf.o subr_rmap.o sys_generic.o sys_inode.o sys_pipe.o \
|
||||
sys_process.o syscalls.o tty.o tty_subr.o tty_tty.o ufs_alloc.o \
|
||||
ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \
|
||||
ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o \
|
||||
ufs_syscalls2.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o adc.o \
|
||||
clock.o cons.o devsw.o exception.o gpio.o machdep.o mem.o pwm.o \
|
||||
rd_sd.o signal.o spi.o spi_bus.o swap.o sysctl.o uart.o
|
||||
|
||||
CFILES = $S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
|
||||
$S/kernel/exec_script.c $S/kernel/exec_subr.c \
|
||||
$S/kernel/init_main.c $S/kernel/init_sysent.c \
|
||||
$S/kernel/kern_clock.c $S/kernel/kern_descrip.c \
|
||||
$S/kernel/kern_exec.c $S/kernel/kern_exit.c \
|
||||
$S/kernel/kern_fork.c $S/kernel/kern_mman.c \
|
||||
$S/kernel/kern_proc.c $S/kernel/kern_prot.c \
|
||||
$S/kernel/kern_prot2.c $S/kernel/kern_resource.c \
|
||||
$S/kernel/kern_sig.c $S/kernel/kern_sig2.c $S/kernel/kern_subr.c \
|
||||
$S/kernel/kern_synch.c $S/kernel/kern_sysctl.c \
|
||||
$S/kernel/kern_time.c $S/kernel/rdisk.c $S/kernel/subr_prf.c \
|
||||
$S/kernel/subr_rmap.c $S/kernel/sys_generic.c \
|
||||
$S/kernel/sys_inode.c $S/kernel/sys_pipe.c \
|
||||
$S/kernel/sys_process.c $S/kernel/syscalls.c $S/kernel/tty.c \
|
||||
$S/kernel/tty_subr.c $S/kernel/tty_tty.c $S/kernel/ufs_alloc.c \
|
||||
$S/kernel/ufs_bio.c $S/kernel/ufs_bmap.c $S/kernel/ufs_dsort.c \
|
||||
$S/kernel/ufs_fio.c $S/kernel/ufs_inode.c $S/kernel/ufs_mount.c \
|
||||
$S/kernel/ufs_namei.c $S/kernel/ufs_subr.c \
|
||||
$S/kernel/ufs_syscalls.c $S/kernel/ufs_syscalls2.c \
|
||||
$S/kernel/vfs_vnops.c $S/kernel/vm_sched.c $S/kernel/vm_swap.c \
|
||||
$S/kernel/vm_swp.c $S/pic32/adc.c $S/pic32/clock.c \
|
||||
$S/pic32/cons.c $S/pic32/devsw.c $S/pic32/exception.c \
|
||||
$S/pic32/gpio.c $S/pic32/machdep.c $S/pic32/mem.c $S/pic32/pwm.c \
|
||||
$S/pic32/rd_sd.c $S/pic32/signal.c $S/pic32/spi.c \
|
||||
$S/pic32/spi_bus.c $S/pic32/swap.c $S/pic32/sysctl.c \
|
||||
$S/pic32/uart.c swapunix.c
|
||||
|
||||
# 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
|
||||
|
||||
unix: unix.elf
|
||||
|
||||
unix.elf: ${SYSTEM_DEP} swapunix.o
|
||||
${SYSTEM_LD_HEAD}
|
||||
${SYSTEM_LD} swapunix.o
|
||||
${SYSTEM_LD_TAIL}
|
||||
|
||||
swapunix.o: swapunix.c
|
||||
${COMPILE_C}
|
||||
|
||||
all: unix
|
||||
|
||||
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}
|
||||
|
||||
exec_aout.o: $S/kernel/exec_aout.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_conf.o: $S/kernel/exec_conf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_elf.o: $S/kernel/exec_elf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_script.o: $S/kernel/exec_script.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_subr.o: $S/kernel/exec_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_main.o: $S/kernel/init_main.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_sysent.o: $S/kernel/init_sysent.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_clock.o: $S/kernel/kern_clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_descrip.o: $S/kernel/kern_descrip.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exec.o: $S/kernel/kern_exec.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exit.o: $S/kernel/kern_exit.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_fork.o: $S/kernel/kern_fork.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_mman.o: $S/kernel/kern_mman.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_proc.o: $S/kernel/kern_proc.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot.o: $S/kernel/kern_prot.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot2.o: $S/kernel/kern_prot2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_resource.o: $S/kernel/kern_resource.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig.o: $S/kernel/kern_sig.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig2.o: $S/kernel/kern_sig2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_subr.o: $S/kernel/kern_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_synch.o: $S/kernel/kern_synch.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sysctl.o: $S/kernel/kern_sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_time.o: $S/kernel/kern_time.c
|
||||
${COMPILE_C}
|
||||
|
||||
rdisk.o: $S/kernel/rdisk.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_prf.o: $S/kernel/subr_prf.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_rmap.o: $S/kernel/subr_rmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_generic.o: $S/kernel/sys_generic.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_inode.o: $S/kernel/sys_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_pipe.o: $S/kernel/sys_pipe.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_process.o: $S/kernel/sys_process.c
|
||||
${COMPILE_C}
|
||||
|
||||
syscalls.o: $S/kernel/syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty.o: $S/kernel/tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_subr.o: $S/kernel/tty_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_tty.o: $S/kernel/tty_tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_alloc.o: $S/kernel/ufs_alloc.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bio.o: $S/kernel/ufs_bio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bmap.o: $S/kernel/ufs_bmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_dsort.o: $S/kernel/ufs_dsort.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_fio.o: $S/kernel/ufs_fio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_inode.o: $S/kernel/ufs_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_mount.o: $S/kernel/ufs_mount.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_namei.o: $S/kernel/ufs_namei.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_subr.o: $S/kernel/ufs_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
|
||||
${COMPILE_C}
|
||||
|
||||
vfs_vnops.o: $S/kernel/vfs_vnops.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_sched.o: $S/kernel/vm_sched.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swap.o: $S/kernel/vm_swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swp.o: $S/kernel/vm_swp.c
|
||||
${COMPILE_C}
|
||||
|
||||
adc.o: $S/pic32/adc.c
|
||||
${COMPILE_C}
|
||||
|
||||
clock.o: $S/pic32/clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
cons.o: $S/pic32/cons.c
|
||||
${COMPILE_C}
|
||||
|
||||
devsw.o: $S/pic32/devsw.c
|
||||
${COMPILE_C}
|
||||
|
||||
exception.o: $S/pic32/exception.c
|
||||
${COMPILE_C}
|
||||
|
||||
gpio.o: $S/pic32/gpio.c
|
||||
${COMPILE_C}
|
||||
|
||||
machdep.o: $S/pic32/machdep.c
|
||||
${COMPILE_C}
|
||||
|
||||
mem.o: $S/pic32/mem.c
|
||||
${COMPILE_C}
|
||||
|
||||
pwm.o: $S/pic32/pwm.c
|
||||
${COMPILE_C}
|
||||
|
||||
rd_sd.o: $S/pic32/rd_sd.c
|
||||
${COMPILE_C}
|
||||
|
||||
signal.o: $S/pic32/signal.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi.o: $S/pic32/spi.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi_bus.o: $S/pic32/spi_bus.c
|
||||
${COMPILE_C}
|
||||
|
||||
swap.o: $S/pic32/swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sysctl.o: $S/pic32/sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
uart.o: $S/pic32/uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bare.ld
|
||||
|
||||
CONFIG = EXPLORER16
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
|
||||
79
sys/pic32/files.kconf
Normal file
79
sys/pic32/files.kconf
Normal file
@@ -0,0 +1,79 @@
|
||||
kernel/exec_aout.c standard
|
||||
kernel/exec_conf.c standard
|
||||
kernel/exec_elf.c standard
|
||||
kernel/exec_script.c standard
|
||||
kernel/exec_subr.c standard
|
||||
kernel/init_main.c standard
|
||||
kernel/init_sysent.c standard
|
||||
kernel/kern_clock.c standard
|
||||
kernel/kern_descrip.c standard
|
||||
kernel/kern_exec.c standard
|
||||
kernel/kern_exit.c standard
|
||||
kernel/kern_fork.c standard
|
||||
kernel/kern_mman.c standard
|
||||
kernel/kern_proc.c standard
|
||||
kernel/kern_prot.c standard
|
||||
kernel/kern_prot2.c standard
|
||||
kernel/kern_resource.c standard
|
||||
kernel/kern_sig.c standard
|
||||
kernel/kern_sig2.c standard
|
||||
kernel/kern_subr.c standard
|
||||
kernel/kern_synch.c standard
|
||||
kernel/kern_sysctl.c standard
|
||||
kernel/kern_time.c standard
|
||||
kernel/rdisk.c standard
|
||||
kernel/subr_log.c optional log
|
||||
kernel/subr_prf.c standard
|
||||
kernel/subr_rmap.c standard
|
||||
kernel/sys_generic.c standard
|
||||
kernel/sys_inode.c standard
|
||||
kernel/sys_pipe.c standard
|
||||
kernel/sys_process.c standard
|
||||
kernel/syscalls.c standard
|
||||
kernel/tty.c standard
|
||||
kernel/tty_subr.c standard
|
||||
kernel/tty_tty.c standard
|
||||
kernel/ufs_alloc.c standard
|
||||
kernel/ufs_bio.c standard
|
||||
kernel/ufs_bmap.c standard
|
||||
kernel/ufs_dsort.c standard
|
||||
kernel/ufs_fio.c standard
|
||||
kernel/ufs_inode.c standard
|
||||
kernel/ufs_mount.c standard
|
||||
kernel/ufs_namei.c standard
|
||||
kernel/ufs_subr.c standard
|
||||
kernel/ufs_syscalls.c standard
|
||||
kernel/ufs_syscalls2.c standard
|
||||
kernel/vfs_vnops.c standard
|
||||
kernel/vm_sched.c standard
|
||||
kernel/vm_swap.c standard
|
||||
kernel/vm_swp.c standard
|
||||
pic32/adc.c optional adc
|
||||
pic32/clock.c standard
|
||||
pic32/cons.c standard
|
||||
pic32/devsw.c standard
|
||||
pic32/exception.c standard
|
||||
pic32/glcd.c optional glcd
|
||||
pic32/gpio.c optional gpio
|
||||
pic32/hx8357.c optional hxtft
|
||||
pic32/machdep.c standard
|
||||
pic32/mem.c standard
|
||||
pic32/picga.c optional picga
|
||||
pic32/power_control.c optional power
|
||||
pic32/pwm.c optional pwm
|
||||
pic32/rd_mrams.c optional mrams
|
||||
pic32/rd_sd.c optional sd
|
||||
pic32/rd_sdramp.c optional sdramp
|
||||
pic32/rd_spirams.c optional spirams
|
||||
pic32/rd_sramc.c optional sramc
|
||||
pic32/sdram.S optional sdramp
|
||||
pic32/signal.c standard
|
||||
pic32/skel.c optional skel
|
||||
pic32/spi.c optional spi
|
||||
pic32/spi_bus.c optional spi
|
||||
pic32/swap.c standard
|
||||
pic32/sysctl.c standard
|
||||
pic32/uart.c optional uart
|
||||
pic32/usb_device.c optional uartusb
|
||||
pic32/usb_function_cdc.c optional uartusb
|
||||
pic32/usb_uart.c optional uartusb
|
||||
3
sys/pic32/fubarino/.gitignore
vendored
3
sys/pic32/fubarino/.gitignore
vendored
@@ -7,3 +7,6 @@ unix.bin
|
||||
unix.map
|
||||
usbboot.map
|
||||
vers.c
|
||||
*.h
|
||||
ioconf.c
|
||||
swapunix.c
|
||||
|
||||
61
sys/pic32/fubarino/Config
Normal file
61
sys/pic32/fubarino/Config
Normal file
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# Fubarino SD board
|
||||
# ==================================
|
||||
# Console on USB.
|
||||
# For details, see https://github.com/RetroBSD/retrobsd/wiki/Board-Fubarino-SD
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/fubarino
|
||||
# kconfig Config
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "FUBARINO" # Board type
|
||||
ldscript "max32/bootloader.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISE" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=5" # ...use pin RE5
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
|
||||
|
||||
# Virtual UART on USB
|
||||
device uartusb
|
||||
options "USB_MAX_EP_NUMBER=3"
|
||||
options "USB_NUM_STRING_DESCRIPTORS=3"
|
||||
|
||||
# SPI ports
|
||||
controller spi2 # SD card
|
||||
|
||||
# microSD card
|
||||
device sd0 at spi2 pin RG9 # select pin
|
||||
options "SD0_PORT=2" # sd0 at spi2 TODO: delete
|
||||
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
|
||||
# GLCD driver
|
||||
device glcd
|
||||
67
sys/pic32/fubarino/Config-uart-sramc
Normal file
67
sys/pic32/fubarino/Config-uart-sramc
Normal file
@@ -0,0 +1,67 @@
|
||||
#
|
||||
# Fubarino SD board SRAMC swap disk
|
||||
# =================================
|
||||
# Console on UART2.
|
||||
# Overclocked to 120MHz.
|
||||
# Clock rate increased to 1000Hz.
|
||||
#
|
||||
# To build the kernel, use:
|
||||
# cd sys/pic32/fubarino-uart-sramc
|
||||
# kconfig Config
|
||||
# make clean
|
||||
# make
|
||||
#
|
||||
# Format of this file is described on page:
|
||||
# http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "FUBARINO" # Board type
|
||||
ldscript "max32/bootloader.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
options "HZ=1000" # Rate of clock interrupt
|
||||
options "CPU_KHZ=120000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=120000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
options "NBUF=8"
|
||||
options "NMOUNT=3"
|
||||
options "NPROC=25"
|
||||
|
||||
# LED
|
||||
options "LED_KERNEL_PORT=TRISE" # for kernel activity LED...
|
||||
options "LED_KERNEL_PIN=5" # ...use pin RE5
|
||||
|
||||
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
|
||||
config unix root on sd0a
|
||||
swap on sd0b
|
||||
|
||||
# Console options
|
||||
options "CONSOLE_DEVICE=tty1" # Console on UART2
|
||||
|
||||
# Serial UART ports
|
||||
device uart1 # Additional serial port
|
||||
device uart2 # Console
|
||||
|
||||
# SPI ports
|
||||
controller spi2 # SD card
|
||||
|
||||
# microSD card
|
||||
device sd0 at spi2 pin RG9 # select pin
|
||||
options "SD0_PORT=2" # sd0 at spi2 TODO: delete
|
||||
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
|
||||
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
|
||||
options "SD0_MHZ=20" # increase data speed
|
||||
|
||||
# General purpose I/O ports
|
||||
device gpio
|
||||
|
||||
# ADC driver
|
||||
device adc
|
||||
|
||||
# PWM driver
|
||||
device pwm
|
||||
|
||||
# sramc - SRAM block device
|
||||
device sramc0 # SRAM via 4-wire CPLD interface
|
||||
options "PARTITION='sramc0:sa@2048,fs@6140'" # Partition schema
|
||||
@@ -1,46 +1,363 @@
|
||||
BUILDPATH = ../../../tools/configsys/../../sys/pic32
|
||||
H = ../../../tools/configsys/../../sys/include
|
||||
M = ../../../tools/configsys/../../sys/pic32
|
||||
S = ../../../tools/configsys/../../sys/kernel
|
||||
PARAM = -DFUBARINO
|
||||
PARAM += -DPIC32MX7
|
||||
PARAM += -DUARTUSB_ENABLED
|
||||
PARAM += -DSPI2_ENABLED
|
||||
PARAM += -DSD_ENABLED
|
||||
PARAM += -DGPIO_ENABLED
|
||||
PARAM += -DADC_ENABLED
|
||||
PARAM += -DPWM_ENABLED
|
||||
PARAM += -DGLCD_ENABLED
|
||||
PARAM += -DSD0_CS_PIN=9
|
||||
PARAM += -DSD0_CS_PORT=TRISG
|
||||
PARAM += -DSD0_PORT=2
|
||||
PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3
|
||||
PARAM += -DUSB_MAX_EP_NUMBER=3
|
||||
PARAM += -DCONSOLE_DEVICE=ttyUSB0
|
||||
PARAM += -DLED_KERNEL_PIN=5
|
||||
PARAM += -DLED_KERNEL_PORT=TRISE
|
||||
PARAM += -DBUS_DIV=1
|
||||
PARAM += -DBUS_KHZ=80000
|
||||
PARAM += -DCPU_KHZ=80000
|
||||
LDSCRIPT = "max32/bootloader.ld"
|
||||
#
|
||||
# Makefile for RetroBSD, pic32 target
|
||||
#
|
||||
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
|
||||
#
|
||||
include ../gcc-config.mk
|
||||
|
||||
vpath %.c $(M):$(S)
|
||||
vpath %.S $(M):$(S)
|
||||
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
|
||||
|
||||
KERNOBJ += adc.o clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o glcd.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o pwm.o rd_sd.o rdisk.o signal.o spi.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o usb_device.o usb_function_cdc.o usb_uart.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o
|
||||
EXTRA_TARGETS =
|
||||
ifneq (${MIPS_GCC_FORMAT},)
|
||||
LDFLAGS += -Wl,--oformat=${MIPS_GCC_FORMAT}
|
||||
endif
|
||||
|
||||
DEFS += -DADC_ENABLED=YES
|
||||
DEFS += -DBUS_DIV=1
|
||||
DEFS += -DBUS_KHZ=80000
|
||||
DEFS += -DCONSOLE_DEVICE=ttyUSB0
|
||||
DEFS += -DCPU_IDIV=2
|
||||
DEFS += -DCPU_KHZ=80000
|
||||
DEFS += -DCPU_MUL=20
|
||||
DEFS += -DCPU_ODIV=1
|
||||
DEFS += -DCRYSTAL=8
|
||||
DEFS += -DEXEC_AOUT
|
||||
DEFS += -DEXEC_ELF
|
||||
DEFS += -DEXEC_SCRIPT
|
||||
DEFS += -DGLCD_ENABLED=YES
|
||||
DEFS += -DGPIO_ENABLED=YES
|
||||
DEFS += -DKERNEL
|
||||
DEFS += -DLED_KERNEL_PIN=5
|
||||
DEFS += -DLED_KERNEL_PORT=TRISE
|
||||
DEFS += -DPIC32MX7
|
||||
DEFS += -DPWM_ENABLED=YES
|
||||
DEFS += -DSD0_CS_PIN=9
|
||||
DEFS += -DSD0_CS_PORT=TRISG
|
||||
DEFS += -DSD0_PORT=2
|
||||
DEFS += -DSPI_ENABLED=YES
|
||||
DEFS += -DUARTUSB_ENABLED=YES
|
||||
DEFS += -DUCB_METER
|
||||
DEFS += -DUSB_MAX_EP_NUMBER=3
|
||||
DEFS += -DUSB_NUM_STRING_DESCRIPTORS=3
|
||||
# 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 = exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
|
||||
init_main.o init_sysent.o kern_clock.o kern_descrip.o \
|
||||
kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \
|
||||
kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \
|
||||
kern_subr.o kern_synch.o kern_sysctl.o kern_time.o rdisk.o \
|
||||
subr_prf.o subr_rmap.o sys_generic.o sys_inode.o sys_pipe.o \
|
||||
sys_process.o syscalls.o tty.o tty_subr.o tty_tty.o ufs_alloc.o \
|
||||
ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \
|
||||
ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o \
|
||||
ufs_syscalls2.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o adc.o \
|
||||
clock.o cons.o devsw.o exception.o glcd.o gpio.o machdep.o mem.o \
|
||||
pwm.o rd_sd.o signal.o spi.o spi_bus.o swap.o sysctl.o \
|
||||
usb_device.o usb_function_cdc.o usb_uart.o
|
||||
|
||||
CFILES = $S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
|
||||
$S/kernel/exec_script.c $S/kernel/exec_subr.c \
|
||||
$S/kernel/init_main.c $S/kernel/init_sysent.c \
|
||||
$S/kernel/kern_clock.c $S/kernel/kern_descrip.c \
|
||||
$S/kernel/kern_exec.c $S/kernel/kern_exit.c \
|
||||
$S/kernel/kern_fork.c $S/kernel/kern_mman.c \
|
||||
$S/kernel/kern_proc.c $S/kernel/kern_prot.c \
|
||||
$S/kernel/kern_prot2.c $S/kernel/kern_resource.c \
|
||||
$S/kernel/kern_sig.c $S/kernel/kern_sig2.c $S/kernel/kern_subr.c \
|
||||
$S/kernel/kern_synch.c $S/kernel/kern_sysctl.c \
|
||||
$S/kernel/kern_time.c $S/kernel/rdisk.c $S/kernel/subr_prf.c \
|
||||
$S/kernel/subr_rmap.c $S/kernel/sys_generic.c \
|
||||
$S/kernel/sys_inode.c $S/kernel/sys_pipe.c \
|
||||
$S/kernel/sys_process.c $S/kernel/syscalls.c $S/kernel/tty.c \
|
||||
$S/kernel/tty_subr.c $S/kernel/tty_tty.c $S/kernel/ufs_alloc.c \
|
||||
$S/kernel/ufs_bio.c $S/kernel/ufs_bmap.c $S/kernel/ufs_dsort.c \
|
||||
$S/kernel/ufs_fio.c $S/kernel/ufs_inode.c $S/kernel/ufs_mount.c \
|
||||
$S/kernel/ufs_namei.c $S/kernel/ufs_subr.c \
|
||||
$S/kernel/ufs_syscalls.c $S/kernel/ufs_syscalls2.c \
|
||||
$S/kernel/vfs_vnops.c $S/kernel/vm_sched.c $S/kernel/vm_swap.c \
|
||||
$S/kernel/vm_swp.c $S/pic32/adc.c $S/pic32/clock.c \
|
||||
$S/pic32/cons.c $S/pic32/devsw.c $S/pic32/exception.c \
|
||||
$S/pic32/glcd.c $S/pic32/gpio.c $S/pic32/machdep.c \
|
||||
$S/pic32/mem.c $S/pic32/pwm.c $S/pic32/rd_sd.c $S/pic32/signal.c \
|
||||
$S/pic32/spi.c $S/pic32/spi_bus.c $S/pic32/swap.c \
|
||||
$S/pic32/sysctl.c $S/pic32/usb_device.c \
|
||||
$S/pic32/usb_function_cdc.c $S/pic32/usb_uart.c swapunix.c
|
||||
|
||||
# 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
|
||||
|
||||
unix: unix.elf
|
||||
|
||||
unix.elf: ${SYSTEM_DEP} swapunix.o
|
||||
${SYSTEM_LD_HEAD}
|
||||
${SYSTEM_LD} swapunix.o
|
||||
${SYSTEM_LD_TAIL}
|
||||
|
||||
swapunix.o: swapunix.c
|
||||
${COMPILE_C}
|
||||
|
||||
all: unix
|
||||
|
||||
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}
|
||||
|
||||
exec_aout.o: $S/kernel/exec_aout.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_conf.o: $S/kernel/exec_conf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_elf.o: $S/kernel/exec_elf.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_script.o: $S/kernel/exec_script.c
|
||||
${COMPILE_C}
|
||||
|
||||
exec_subr.o: $S/kernel/exec_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_main.o: $S/kernel/init_main.c
|
||||
${COMPILE_C}
|
||||
|
||||
init_sysent.o: $S/kernel/init_sysent.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_clock.o: $S/kernel/kern_clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_descrip.o: $S/kernel/kern_descrip.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exec.o: $S/kernel/kern_exec.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_exit.o: $S/kernel/kern_exit.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_fork.o: $S/kernel/kern_fork.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_mman.o: $S/kernel/kern_mman.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_proc.o: $S/kernel/kern_proc.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot.o: $S/kernel/kern_prot.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_prot2.o: $S/kernel/kern_prot2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_resource.o: $S/kernel/kern_resource.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig.o: $S/kernel/kern_sig.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sig2.o: $S/kernel/kern_sig2.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_subr.o: $S/kernel/kern_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_synch.o: $S/kernel/kern_synch.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_sysctl.o: $S/kernel/kern_sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
kern_time.o: $S/kernel/kern_time.c
|
||||
${COMPILE_C}
|
||||
|
||||
rdisk.o: $S/kernel/rdisk.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_prf.o: $S/kernel/subr_prf.c
|
||||
${COMPILE_C}
|
||||
|
||||
subr_rmap.o: $S/kernel/subr_rmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_generic.o: $S/kernel/sys_generic.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_inode.o: $S/kernel/sys_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_pipe.o: $S/kernel/sys_pipe.c
|
||||
${COMPILE_C}
|
||||
|
||||
sys_process.o: $S/kernel/sys_process.c
|
||||
${COMPILE_C}
|
||||
|
||||
syscalls.o: $S/kernel/syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty.o: $S/kernel/tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_subr.o: $S/kernel/tty_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
tty_tty.o: $S/kernel/tty_tty.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_alloc.o: $S/kernel/ufs_alloc.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bio.o: $S/kernel/ufs_bio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_bmap.o: $S/kernel/ufs_bmap.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_dsort.o: $S/kernel/ufs_dsort.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_fio.o: $S/kernel/ufs_fio.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_inode.o: $S/kernel/ufs_inode.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_mount.o: $S/kernel/ufs_mount.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_namei.o: $S/kernel/ufs_namei.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_subr.o: $S/kernel/ufs_subr.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
|
||||
${COMPILE_C}
|
||||
|
||||
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
|
||||
${COMPILE_C}
|
||||
|
||||
vfs_vnops.o: $S/kernel/vfs_vnops.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_sched.o: $S/kernel/vm_sched.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swap.o: $S/kernel/vm_swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
vm_swp.o: $S/kernel/vm_swp.c
|
||||
${COMPILE_C}
|
||||
|
||||
adc.o: $S/pic32/adc.c
|
||||
${COMPILE_C}
|
||||
|
||||
clock.o: $S/pic32/clock.c
|
||||
${COMPILE_C}
|
||||
|
||||
cons.o: $S/pic32/cons.c
|
||||
${COMPILE_C}
|
||||
|
||||
devsw.o: $S/pic32/devsw.c
|
||||
${COMPILE_C}
|
||||
|
||||
exception.o: $S/pic32/exception.c
|
||||
${COMPILE_C}
|
||||
|
||||
glcd.o: $S/pic32/glcd.c
|
||||
${COMPILE_C}
|
||||
|
||||
gpio.o: $S/pic32/gpio.c
|
||||
${COMPILE_C}
|
||||
|
||||
machdep.o: $S/pic32/machdep.c
|
||||
${COMPILE_C}
|
||||
|
||||
mem.o: $S/pic32/mem.c
|
||||
${COMPILE_C}
|
||||
|
||||
pwm.o: $S/pic32/pwm.c
|
||||
${COMPILE_C}
|
||||
|
||||
rd_sd.o: $S/pic32/rd_sd.c
|
||||
${COMPILE_C}
|
||||
|
||||
signal.o: $S/pic32/signal.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi.o: $S/pic32/spi.c
|
||||
${COMPILE_C}
|
||||
|
||||
spi_bus.o: $S/pic32/spi_bus.c
|
||||
${COMPILE_C}
|
||||
|
||||
swap.o: $S/pic32/swap.c
|
||||
${COMPILE_C}
|
||||
|
||||
sysctl.o: $S/pic32/sysctl.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_device.o: $S/pic32/usb_device.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_function_cdc.o: $S/pic32/usb_function_cdc.c
|
||||
${COMPILE_C}
|
||||
|
||||
usb_uart.o: $S/pic32/usb_uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-max32.ld
|
||||
|
||||
CONFIG = FUBARINO
|
||||
CONFIGPATH = ../../../tools/configsys
|
||||
|
||||
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# chipKIT PIC32 compiler from UECIDE
|
||||
ifdef UECIDE
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX = ${UECIDE}/compilers/pic32-tools/bin/pic32-
|
||||
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
|
||||
endif
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Use UECIDE package from http://uecide.org/download
|
||||
ifndef MIPS_GCC_PREFIX
|
||||
ifdef UECIDE
|
||||
MIPS_GCC_PREFIX = $(UECIDE)/compilers/pic32-tools/bin/pic32-
|
||||
MIPS_GCC_FORMAT = elf32-tradlittlemips
|
||||
endif
|
||||
endif
|
||||
|
||||
# chipKIT PIC32 compiler on Linux
|
||||
@@ -14,62 +16,53 @@ endif
|
||||
# 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
|
||||
endif
|
||||
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 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 =
|
||||
endif
|
||||
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
|
||||
|
||||
# Mentor Sourcery CodeBench Lite toolchain
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# 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
|
||||
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
|
||||
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
|
||||
|
||||
ifndef GCCPREFIX
|
||||
# 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
|
||||
|
||||
ifndef MIPS_GCC_PREFIX
|
||||
$(error Unable to locate any GCC MIPS toolchain!)
|
||||
endif
|
||||
|
||||
# UECIDE on Linux
|
||||
ifneq (,$(wildcard $UECIDE/cores/chipKIT))
|
||||
AVRDUDE = $UECIDE/cores/chipKIT/tools/linux64/avrdude \
|
||||
-C $UECIDE/cores/chipKIT/tools/linux64/avrdude.conf -V \
|
||||
-P /dev/ttyUSB*
|
||||
endif
|
||||
|
||||
# chipKIT MPIDE on Mac OS X
|
||||
ifneq (,$(wildcard /Applications/Mpide.app/Contents/Resources/Java/hardware/tools/avr))
|
||||
AVRDUDE = /Applications/Mpide.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude \
|
||||
-C /Applications/Mpide.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf \
|
||||
-P /dev/tty.usbserial-*
|
||||
endif
|
||||
|
||||
# chipKIT MPIDE on Linux
|
||||
ifneq (,$(wildcard /opt/mpide-0023-linux-20120903/hardware/tools/avrdude))
|
||||
AVRDUDE = /opt/mpide-0023-linux-20120903/hardware/tools/avrdude \
|
||||
-C /opt/mpide-0023-linux-20120903/hardware/tools/avrdude.conf \
|
||||
-P /dev/ttyUSB0
|
||||
endif
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
* arising out of or in connection with the use or performance of
|
||||
* this software.
|
||||
*/
|
||||
#include "param.h"
|
||||
#include "conf.h"
|
||||
#include "user.h"
|
||||
#include "ioctl.h"
|
||||
#include "systm.h"
|
||||
#include "sys/uio.h"
|
||||
#include "glcd.h"
|
||||
#include "debug.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/glcd.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
const struct devspec glcddevs[] = {
|
||||
{ 0, "glcd0" },
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user