Fix include paths in the kernel sources.

Max32 kernel successfully compiled with kconfig utility.
This commit is contained in:
Serge Vakulenko
2015-08-31 00:21:41 -07:00
parent d80a636a62
commit 585773955b
88 changed files with 1098 additions and 787 deletions

View File

@@ -51,7 +51,7 @@
/* /*
* Signals * Signals
*/ */
#include <signal.h> #include <sys/signal.h>
#define NBPW sizeof(int) /* number of bytes in an integer */ #define NBPW sizeof(int) /* number of bytes in an integer */
@@ -111,7 +111,7 @@
#define MAXHOSTNAMELEN 64 #define MAXHOSTNAMELEN 64
#if defined(KERNEL) && defined(INET) #if defined(KERNEL) && defined(INET)
# include "machine/net_mac.h" # include <machine/net_mac.h>
#endif #endif
/* /*

View File

@@ -1,20 +1,20 @@
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "map.h" #include <sys/map.h>
#include "inode.h" #include <sys/inode.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "buf.h" #include <sys/buf.h>
#include "namei.h" #include <sys/namei.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "file.h" #include <sys/file.h>
#include "resource.h" #include <sys/resource.h>
#include "exec.h" #include <sys/exec.h>
#include "exec_aout.h" #include <sys/exec_aout.h>
#include "dir.h" #include <sys/dir.h>
#include "uio.h" #include <sys/uio.h>
#include "debug.h" #include <sys/debug.h>
int exec_aout_check(struct exec_params *epp) int exec_aout_check(struct exec_params *epp)
{ {

View File

@@ -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 * Copyright (c) 1993, 1994 Christopher G. Demetriou
* All rights reserved. * All rights reserved.
@@ -29,10 +27,9 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <sys/param.h>
#include "param.h" #include <sys/inode.h>
#include "inode.h" #include <sys/exec.h>
#include "exec.h"
#ifdef EXEC_SCRIPT #ifdef EXEC_SCRIPT
int exec_script_check(struct exec_params *epp); int exec_script_check(struct exec_params *epp);

View File

@@ -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. * Copyright (c) 1994 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
@@ -62,22 +60,20 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <sys/param.h>
#include <sys/systm.h>
#include "param.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/map.h>
#include "kernel.h" #include <sys/user.h>
#include "map.h" #include <sys/proc.h>
#include "user.h" #include <sys/inode.h>
#include "proc.h" #include <sys/namei.h>
#include "inode.h" #include <sys/exec.h>
#include "namei.h" #include <sys/exec_elf.h>
#include "exec.h" #include <sys/fcntl.h>
#include "exec_elf.h" #include <sys/signalvar.h>
#include "fcntl.h" #include <sys/mount.h>
#include "signalvar.h" #include <sys/stat.h>
#include "mount.h"
#include "stat.h"
extern char sigcode[], esigcode[]; extern char sigcode[], esigcode[];

View File

@@ -1,10 +1,10 @@
#include "param.h" #include <sys/param.h>
#include "inode.h" #include <sys/inode.h>
#include "dir.h" #include <sys/dir.h>
#include "namei.h" #include <sys/namei.h>
#include "exec.h" #include <sys/exec.h>
#include "user.h" #include <sys/user.h>
#include "systm.h" #include <sys/systm.h>
int int
exec_script_check(struct exec_params *epp) exec_script_check(struct exec_params *epp)

View File

@@ -1,19 +1,19 @@
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "map.h" #include <sys/map.h>
#include "inode.h" #include <sys/inode.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "buf.h" #include <sys/buf.h>
#include "namei.h" #include <sys/namei.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "file.h" #include <sys/file.h>
#include "resource.h" #include <sys/resource.h>
#include "exec.h" #include <sys/exec.h>
#include "dir.h" #include <sys/dir.h>
#include "uio.h" #include <sys/uio.h>
#include "debug.h" #include <sys/debug.h>
/* /*
* How memory is set up. * How memory is set up.

View File

@@ -3,25 +3,25 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "map.h" #include <sys/map.h>
#include "proc.h" #include <sys/proc.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "inode.h" #include <sys/inode.h>
#include "conf.h" #include <sys/conf.h>
#include "buf.h" #include <sys/buf.h>
#include "fcntl.h" #include <sys/fcntl.h>
#include "vm.h" #include <sys/vm.h>
#include "clist.h" #include <sys/clist.h>
#include "reboot.h" #include <sys/reboot.h>
#include "systm.h" #include <sys/systm.h>
#include "kernel.h" #include <sys/kernel.h>
#include "namei.h" #include <sys/namei.h>
#include "stat.h" #include <sys/stat.h>
#include "rdisk.h" #include <sys/rdisk.h>
u_int swapstart, nswap; /* start and size of swap space */ u_int swapstart, nswap; /* start and size of swap space */
size_t physmem; /* total amount of physical memory */ size_t physmem; /* total amount of physical memory */
@@ -150,8 +150,11 @@ main()
s = spl0(); s = spl0();
rdisk_init(); rdisk_init();
pipedev = rootdev = get_boot_device(); if (rootdev == NODEV)
swapdev = get_swap_device(); rootdev = get_boot_device();
if (swapdev == NODEV)
swapdev = get_swap_device();
pipedev = rootdev;
/* Mount a root filesystem. */ /* Mount a root filesystem. */
for (;;) { for (;;) {

View File

@@ -5,9 +5,9 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "glob.h" #include <sys/glob.h>
#ifdef INET #ifdef INET
# define ifnet(narg, name) narg, name # define ifnet(narg, name) narg, name

View File

@@ -3,13 +3,13 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "callout.h" #include <sys/callout.h>
#include "dk.h" #include <sys/dk.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
int noproc; /* no one is running just now */ int noproc; /* no one is running just now */

View File

@@ -3,20 +3,20 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "file.h" #include <sys/file.h>
#include "systm.h" #include <sys/systm.h>
#include "inode.h" #include <sys/inode.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "stat.h" #include <sys/stat.h>
#include "conf.h" #include <sys/conf.h>
#ifdef INET #ifdef INET
#include "socket.h" #include <sys/socket.h>
#include "socketvar.h" #include <sys/socketvar.h>
#endif #endif
#include <syslog.h> #include <sys/syslog.h>
const struct devspec fddevs[] = { const struct devspec fddevs[] = {
{ 0, "stdin" }, { 0, "stdin" },

View File

@@ -3,20 +3,20 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "map.h" #include <sys/map.h>
#include "inode.h" #include <sys/inode.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "buf.h" #include <sys/buf.h>
#include "namei.h" #include <sys/namei.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "file.h" #include <sys/file.h>
#include "signalvar.h" #include <sys/signalvar.h>
#include "exec.h" #include <sys/exec.h>
#include "debug.h" #include <sys/debug.h>
/* /*
* exec system call, with and without environments. * exec system call, with and without environments.
@@ -153,4 +153,3 @@ done:
if (ip) if (ip)
iput(ip); iput(ip);
} }

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "map.h" #include <sys/map.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "inode.h" #include <sys/inode.h>
#include "vm.h" #include <sys/vm.h>
#include "file.h" #include <sys/file.h>
#include "wait.h" #include <sys/wait.h>
#include "kernel.h" #include <sys/kernel.h>
/* /*
* Notify parent that vfork child is finished with parent's data. Called * Notify parent that vfork child is finished with parent's data. Called

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "map.h" #include <sys/map.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "inode.h" #include <sys/inode.h>
#include "file.h" #include <sys/file.h>
#include "vm.h" #include <sys/vm.h>
#include "kernel.h" #include <sys/kernel.h>
#include "syslog.h" #include <sys/syslog.h>
int mpid; /* generic for unique process id's */ int mpid; /* generic for unique process id's */

View File

@@ -6,9 +6,9 @@
* byte = rdglob(addr); * byte = rdglob(addr);
* success = wrglob(addr,byte); * success = wrglob(addr,byte);
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#ifndef GLOBSZ #ifndef GLOBSZ
#define GLOBSZ 256 #define GLOBSZ 256

View File

@@ -3,11 +3,11 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "vm.h" #include <sys/vm.h>
#include "systm.h" #include <sys/systm.h>
void void
brk() brk()

View File

@@ -3,10 +3,10 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "systm.h" #include <sys/systm.h>
/* /*
* Is p an inferior of the current process? * Is p an inferior of the current process?

View File

@@ -5,10 +5,10 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "systm.h" #include <sys/systm.h>
void void
getpid() getpid()

View File

@@ -35,10 +35,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "systm.h" #include <sys/systm.h>
void void
setuid() setuid()

View File

@@ -3,12 +3,12 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "systm.h" #include <sys/systm.h>
#include "vm.h" #include <sys/vm.h>
#include "kernel.h" #include <sys/kernel.h>
/* /*
* Resource controls and accounting. * Resource controls and accounting.

View File

@@ -3,13 +3,13 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#include "inode.h" #include <sys/inode.h>
#include "proc.h" #include <sys/proc.h>
#include "namei.h" #include <sys/namei.h>
#include "signalvar.h" #include <sys/signalvar.h>
/* /*
* Can the current process send the signal `signum' to process `q'? * Can the current process send the signal `signum' to process `q'?

View File

@@ -3,11 +3,11 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#include "buf.h" #include <sys/buf.h>
#include "uio.h" #include <sys/uio.h>
/* /*
* Move data to/from user space. * Move data to/from user space.

View File

@@ -3,15 +3,15 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "buf.h" #include <sys/buf.h>
#include "signal.h" #include <sys/signal.h>
#include "signalvar.h" #include <sys/signalvar.h>
#include "vm.h" #include <sys/vm.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
#define SQSIZE 16 /* Must be power of 2 */ #define SQSIZE 16 /* Must be power of 2 */

View File

@@ -49,7 +49,7 @@
#include <sys/map.h> #include <sys/map.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <machine/cpu.h> #include <machine/cpu.h>
#include <conf.h> #include <sys/conf.h>
sysctlfn kern_sysctl; sysctlfn kern_sysctl;
sysctlfn hw_sysctl; sysctlfn hw_sysctl;

View File

@@ -3,11 +3,11 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
static void static void
setthetime (tv) setthetime (tv)

View File

@@ -1,12 +1,12 @@
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "buf.h" #include <sys/buf.h>
#include "errno.h" #include <sys/errno.h>
#include "dk.h" #include <sys/dk.h>
#include "debug.h" #include <sys/debug.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "rdisk.h" #include <sys/rdisk.h>
#include "conf.h" #include <sys/conf.h>
#define Q2(X) #X #define Q2(X) #X
#define QUOTE(X) Q2((X)) #define QUOTE(X) Q2((X))

View File

@@ -19,18 +19,18 @@
#define NLOG 1 #define NLOG 1
int nlog = 1; int nlog = 1;
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "msgbuf.h" #include <sys/msgbuf.h>
#include "file.h" #include <sys/file.h>
#include "inode.h" #include <sys/inode.h>
#include "errno.h" #include <sys/errno.h>
#include "uio.h" #include <sys/uio.h>
#include "map.h" #include <sys/map.h>
#include "systm.h" #include <sys/systm.h>
#include "conf.h" #include <sys/conf.h>
const struct devspec logdevs[] = { const struct devspec logdevs[] = {
{ 0, "klog" }, { 0, "klog" },

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "buf.h" #include <sys/buf.h>
#include "msgbuf.h" #include <sys/msgbuf.h>
#include "conf.h" #include <sys/conf.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "reboot.h" #include <sys/reboot.h>
#include "systm.h" #include <sys/systm.h>
#include "syslog.h" #include <sys/syslog.h>
#define TOCONS 0x1 #define TOCONS 0x1
#define TOTTY 0x2 #define TOTTY 0x2

View File

@@ -3,10 +3,10 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "map.h" #include <sys/map.h>
#include "vm.h" #include <sys/vm.h>
/* /*
* Resource map handling routines. * Resource map handling routines.

View File

@@ -3,17 +3,17 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "signalvar.h" #include <sys/signalvar.h>
#include "inode.h" #include <sys/inode.h>
#include "file.h" #include <sys/file.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "conf.h" #include <sys/conf.h>
#include "uio.h" #include <sys/uio.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
int selwait; int selwait;

View File

@@ -3,23 +3,23 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "signalvar.h" #include <sys/signalvar.h>
#include "inode.h" #include <sys/inode.h>
#include "buf.h" #include <sys/buf.h>
#include "fs.h" #include <sys/fs.h>
#include "file.h" #include <sys/file.h>
#include "stat.h" #include <sys/stat.h>
#include "mount.h" #include <sys/mount.h>
#include "conf.h" #include <sys/conf.h>
#include "uio.h" #include <sys/uio.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
#include "syslog.h" #include <sys/syslog.h>
daddr_t rablock; /* block to be read ahead */ daddr_t rablock; /* block to be read ahead */

View File

@@ -3,15 +3,15 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "inode.h" #include <sys/inode.h>
#include "file.h" #include <sys/file.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "uio.h" #include <sys/uio.h>
int int
readp (fp, uio, flag) readp (fp, uio, flag)

View File

@@ -3,13 +3,13 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "inode.h" #include <sys/inode.h>
#include "vm.h" #include <sys/vm.h>
#include "ptrace.h" #include <sys/ptrace.h>
/* /*
* sys-trace system call. * sys-trace system call.

View File

@@ -3,19 +3,19 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "proc.h" #include <sys/proc.h>
#include "file.h" #include <sys/file.h>
#include "conf.h" #include <sys/conf.h>
#include "dk.h" #include <sys/dk.h>
#include "uio.h" #include <sys/uio.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
#include "inode.h" #include <sys/inode.h>
#include "syslog.h" #include <sys/syslog.h>
static int rts = TIOCM_RTS; static int rts = TIOCM_RTS;

View File

@@ -6,22 +6,22 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "pty.h" #include <sys/pty.h>
#if NPTY > 0 #if NPTY > 0
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "user.h" #include <sys/user.h>
#include "conf.h" #include <sys/conf.h>
#include "file.h" #include <sys/file.h>
#include "proc.h" #include <sys/proc.h>
#include "uio.h" #include <sys/uio.h>
#include "kernel.h" #include <sys/kernel.h>
#include "inode.h" #include <sys/inode.h>
#include "types.h" #include <sys/types.h>
#include "ttydev.h" #include <sys/ttydev.h>
const struct devspec ptsdevs[] = { const struct devspec ptsdevs[] = {
{ 0, "ttyp0" }, { 1, "ttyp1" }, { 2, "ttyp2" }, { 3, "ttyp3" }, { 0, "ttyp0" }, { 1, "ttyp1" }, { 2, "ttyp2" }, { 3, "ttyp3" },

View File

@@ -3,11 +3,11 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "clist.h" #include <sys/clist.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "systm.h" #include <sys/systm.h>
char cwaiting; char cwaiting;

View File

@@ -10,12 +10,12 @@
* Indirect driver for controlling tty. * Indirect driver for controlling tty.
* *
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "conf.h" #include <sys/conf.h>
const struct devspec sydevs[] = { const struct devspec sydevs[] = {
{ 0, "tty" }, { 0, "tty" },

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "fs.h" #include <sys/fs.h>
#include "dir.h" #include <sys/dir.h>
#include "inode.h" #include <sys/inode.h>
#include "buf.h" #include <sys/buf.h>
#include "user.h" #include <sys/user.h>
#include "kernel.h" #include <sys/kernel.h>
#include "mount.h" #include <sys/mount.h>
#include "proc.h" #include <sys/proc.h>
#include "systm.h" #include <sys/systm.h>
typedef struct fblk *FBLKP; typedef struct fblk *FBLKP;

View File

@@ -3,15 +3,15 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "buf.h" #include <sys/buf.h>
#include "user.h" #include <sys/user.h>
#include "conf.h" #include <sys/conf.h>
#include "fs.h" #include <sys/fs.h>
#include "dk.h" #include <sys/dk.h>
#include "systm.h" #include <sys/systm.h>
#include "map.h" #include <sys/map.h>
#include "proc.h" #include <sys/proc.h>
/* /*
* Read in (if necessary) the block and return a buffer pointer. * Read in (if necessary) the block and return a buffer pointer.

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "conf.h" #include <sys/conf.h>
#include "dir.h" #include <sys/dir.h>
#include "inode.h" #include <sys/inode.h>
#include "user.h" #include <sys/user.h>
#include "buf.h" #include <sys/buf.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "uio.h" #include <sys/uio.h>
/* /*
* Bmap defines the structure of file system storage * Bmap defines the structure of file system storage

View File

@@ -9,11 +9,10 @@
/* /*
* generalized seek sort for disk * generalized seek sort for disk
*/ */
#include <sys/param.h>
#include "param.h" #include <sys/systm.h>
#include "systm.h" #include <sys/buf.h>
#include "buf.h" #include <sys/dk.h>
#include "dk.h"
void void
disksort (dp, bp) disksort (dp, bp)

View File

@@ -3,14 +3,14 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "fs.h" #include <sys/fs.h>
#include "inode.h" #include <sys/inode.h>
#include "mount.h" #include <sys/mount.h>
#include "namei.h" #include <sys/namei.h>
#include "systm.h" #include <sys/systm.h>
#include "stat.h" #include <sys/stat.h>
/* /*
* Check mode permission on inode pointer. * Check mode permission on inode pointer.

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "inode.h" #include <sys/inode.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "kernel.h" #include <sys/kernel.h>
#include "buf.h" #include <sys/buf.h>
#include "systm.h" #include <sys/systm.h>
#include "syslog.h" #include <sys/syslog.h>
#define INOHSZ 16 /* must be power of two */ #define INOHSZ 16 /* must be power of two */
#define INOHASH(dev,ino) (((dev)+(ino))&(INOHSZ-1)) #define INOHASH(dev,ino) (((dev)+(ino))&(INOHSZ-1))

View File

@@ -3,19 +3,19 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#include "inode.h" #include <sys/inode.h>
#include "fs.h" #include <sys/fs.h>
#include "buf.h" #include <sys/buf.h>
#include "mount.h" #include <sys/mount.h>
#include "file.h" #include <sys/file.h>
#include "namei.h" #include <sys/namei.h>
#include "conf.h" #include <sys/conf.h>
#include "stat.h" #include <sys/stat.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "proc.h" #include <sys/proc.h>
/* /*
* Common code for mount and umount. * Common code for mount and umount.

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "dir.h" #include <sys/dir.h>
#include "inode.h" #include <sys/inode.h>
#include "fs.h" #include <sys/fs.h>
#include "mount.h" #include <sys/mount.h>
#include "user.h" #include <sys/user.h>
#include "buf.h" #include <sys/buf.h>
#include "namei.h" #include <sys/namei.h>
#include "proc.h" #include <sys/proc.h>
int dirchk = 0; int dirchk = 0;

View File

@@ -3,15 +3,15 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "fs.h" #include <sys/fs.h>
#include "inode.h" #include <sys/inode.h>
#include "buf.h" #include <sys/buf.h>
#include "mount.h" #include <sys/mount.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
int updlock; /* lock for sync */ int updlock; /* lock for sync */

View File

@@ -3,16 +3,16 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#include "inode.h" #include <sys/inode.h>
#include "namei.h" #include <sys/namei.h>
#include "fs.h" #include <sys/fs.h>
#include "file.h" #include <sys/file.h>
#include "stat.h" #include <sys/stat.h>
#include "kernel.h" #include <sys/kernel.h>
#include "proc.h" #include <sys/proc.h>
/* /*
* Common routine for chroot and chdir. * Common routine for chroot and chdir.

View File

@@ -2,17 +2,17 @@
* ufs_syscalls was getting too large. Various UFS related system calls were * ufs_syscalls was getting too large. Various UFS related system calls were
* relocated to this file. * relocated to this file.
*/ */
#include "param.h" #include <sys/param.h>
#include "sys/file.h" #include <sys/file.h>
#include "user.h" #include <sys/user.h>
#include "inode.h" #include <sys/inode.h>
#include "buf.h" #include <sys/buf.h>
#include "fs.h" #include <sys/fs.h>
#include "namei.h" #include <sys/namei.h>
#include "mount.h" #include <sys/mount.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
#include "proc.h" #include <sys/proc.h>
static int static int
statfs1 (mp, sbp) statfs1 (mp, sbp)

View File

@@ -41,8 +41,7 @@
#include <sys/namei.h> #include <sys/namei.h>
#include <sys/inode.h> #include <sys/inode.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/systm.h>
#include "systm.h"
/* /*
* 2.11BSD does not have "vnodes", having instead only old fashioned "inodes". * 2.11BSD does not have "vnodes", having instead only old fashioned "inodes".

View File

@@ -3,13 +3,13 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "vm.h" #include <sys/vm.h>
#include "kernel.h" #include <sys/kernel.h>
#include "systm.h" #include <sys/systm.h>
#include "debug.h" #include <sys/debug.h>
#define MINFINITY -32767 /* minus infinity */ #define MINFINITY -32767 /* minus infinity */

View File

@@ -3,13 +3,13 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "map.h" #include <sys/map.h>
#include "buf.h" #include <sys/buf.h>
#include "systm.h" #include <sys/systm.h>
#include "vm.h" #include <sys/vm.h>
/* /*
* Swap a process in. * Swap a process in.

View File

@@ -3,14 +3,14 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "buf.h" #include <sys/buf.h>
#include "conf.h" #include <sys/conf.h>
#include "systm.h" #include <sys/systm.h>
#include "vm.h" #include <sys/vm.h>
#include "uio.h" #include <sys/uio.h>
/* /*
* swap I/O * swap I/O

View File

@@ -9,11 +9,11 @@
# #
machine "pic32" machine "pic32"
cpu "PIC32MX" cpu "PIC32MX7"
ident CHIPKIT_MAX ident CHIPKIT_MAX
# Linker script # Linker script
ldscript "pic32/bootloader-max32.ld" ldscript "cfg/bootloader-max32.ld"
# Need to set locally # Need to set locally
timezone 8 dst timezone 8 dst
@@ -23,11 +23,7 @@ maxusers 2
options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "CPU_KHZ=80000" # Oscillator frequency of CPU core
options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_KHZ=80000" # Frequency of peripheral bus
options "HZ=100" # Rate of clock interrupt options "HZ=100" # Rate of clock interrupt
#???options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
#???options "CRYSTAL=8" # PLL input frequency in MHz
#???options "CPU_IDIV=2" # PLL input divisor 1/2/3/4/5/6/10/12
#???options "CPU_ODIV=1" # PLL output divisor 1/2/4/8/16/32/64/256
#???options "CPU_MUL=20" # PLL multiplier 15/16/17/18/19/20/21/24
options "EXEC_AOUT" # Run a.out binaries options "EXEC_AOUT" # Run a.out binaries
options "EXEC_ELF" # Run ELF binaries options "EXEC_ELF" # Run ELF binaries
options "EXEC_SCRIPT" # Run shell scripts options "EXEC_SCRIPT" # Run shell scripts
@@ -66,8 +62,13 @@ device uart1 # Serial-to-USB converter
device uart2 device uart2
device uart3 device uart3
device uart4 device uart4
options "UART_ENABLED" # TODO: delete this option options "UART1_ENABLED" # TODO: delete this option
options "UART2_ENABLED" # TODO: delete this option
options "UART3_ENABLED" # TODO: delete this option
options "UART4_ENABLED" # TODO: delete this option
options "UART1_BAUD=115200" # default speed 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_BAUD=115200" # default speed
options "UART4_ENA_PORT=TRISB" # to enable power for uart4... options "UART4_ENA_PORT=TRISB" # to enable power for uart4...
options "UART4_ENA_PIN=13" # ...use pin RB13 options "UART4_ENA_PIN=13" # ...use pin RB13

View File

@@ -33,7 +33,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T $A/${LDSCRIPT} -Wl,-Map=unix.map LDFLAGS = -nostdlib -T $S/pic32/${LDSCRIPT} -Wl,-Map=unix.map
SIZE = ${MIPS_GCC_PREFIX}size SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -47,9 +47,8 @@ endif
# source tree is located via $S relative to the compilation directory # source tree is located via $S relative to the compilation directory
S = ../.. S = ../..
A = $S/pic32
COPTS = -I. -I$S/include ${IDENT} -DKERNEL COPTS = -I. ${IDENT} -DKERNEL
CFLAGS = -O ${COPTS} CFLAGS = -O ${COPTS}
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
@@ -65,8 +64,8 @@ DRIVER_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
PROFILE_C = ${CC} -p -c ${COPTS} $< PROFILE_C = ${CC} -p -c ${COPTS} $<
NORMAL_S = ${CPP} ${COPTS} $< | ${AS} -o $@ NORMAL_S = ${CC} -c ${COPTS} $<
NORMAL_S_C = ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ NORMAL_S_C = ${CC} -c ${COPTS} ${PARAM} $<
%OBJS %OBJS
@@ -77,37 +76,43 @@ NORMAL_S_C = ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
# ${SYSTEM_LD_HEAD} # ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD} swapxxx.o
# ${SYSTEM_LD_TAIL} # ${SYSTEM_LD_TAIL}
SYSTEM_OBJ = startup.o ${OBJS} ioconf.o SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c)) ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o SYSTEM_OBJ += devcfg.o
endif endif
SYSTEM_DEP = Makefile machine sys ${SYSTEM_OBJ} SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh $S/pic32/newvers.sh; ${CC} $(CFLAGS) -c vers.c; rm -f $@ SYSTEM_LD_HEAD = sh $S/pic32/newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \ SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf ${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \ SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \ $(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis $(OBJDUMP) -d -S unix.elf > unix.dis
%LOAD %LOAD
clean: clean:
rm -f *.elf *.o *.map *.dis rm -f *.elf *.o *.map *.dis *.bin
clean-all: clean clean-all: clean
rm -f *.h *.c machine sys Makefile rm -f *.h *.c machine sys
#startup.o: $A/pic32/startup.S $A/include/machAsmDefs.h \ reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
# $A/include/machConst.h $A/include/reg.h $A/include/assym.h ../../../tools/kconfig/kconfig Config
# ${CPP} ${COPTS} ${PARAM} -DLOCORE $A/pic32/startup.s | \ $(MAKE) clean
# ${AS} -o startup.o
load: unix.elf
pic32prog unix.hex
startup.o: $S/pic32/startup.S
${NORMAL_S}
# the following are necessary because the files depend on the types of # the following are necessary because the files depend on the types of
# cpu's included in the system configuration # cpu's included in the system configuration
clock.o machdep.o conf.o: Makefile clock.o machdep.o conf.o: Makefile
machine: machine:
ln -s $A $@ ln -s $S/pic32 $@
sys: sys:
ln -s $S/include $@ ln -s $S/include $@

View File

@@ -21,15 +21,14 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include <sys/param.h>
#include "param.h" #include <sys/conf.h>
#include "conf.h" #include <sys/user.h>
#include "user.h" #include <sys/ioctl.h>
#include "ioctl.h" #include <sys/systm.h>
#include "systm.h" #include <sys/uio.h>
#include "uio.h" #include <sys/adc.h>
#include "adc.h" #include <sys/debug.h>
#include "debug.h"
const struct devspec adcdevs[] = { const struct devspec adcdevs[] = {
{ 0, "adc0" }, { 1, "adc1" }, { 2, "adc2" }, { 3, "adc3" }, { 0, "adc0" }, { 1, "adc1" }, { 2, "adc2" }, { 3, "adc3" },

View File

@@ -3,8 +3,8 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "machine/pic32mx.h" #include <machine/pic32mx.h>
/* /*
* Setup core timer for `hz' timer interrupts per second. * Setup core timer for `hz' timer interrupts per second.

View File

@@ -5,15 +5,15 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "systm.h" #include <sys/systm.h>
#include "uart.h" #include <sys/uart.h>
#include "usb_uart.h" #include <sys/usb_uart.h>
#define CONCAT(x,y) x ## y #define CONCAT(x,y) x ## y
#define BBAUD(x) CONCAT(B,x) #define BBAUD(x) CONCAT(B,x)

View File

@@ -3,54 +3,54 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "buf.h" #include <sys/buf.h>
#include "time.h" #include <sys/time.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "resource.h" #include <sys/resource.h>
#include "inode.h" #include <sys/inode.h>
#include "proc.h" #include <sys/proc.h>
#include "clist.h" #include <sys/clist.h>
#include "tty.h" #include <sys/tty.h>
#include "systm.h" #include <sys/systm.h>
#include "rdisk.h" #include <sys/rdisk.h>
#include "errno.h" #include <sys/errno.h>
#include "uart.h" #include <sys/uart.h>
#include "swap.h" #include <sys/swap.h>
extern int strcmp(char *s1, char *s2); extern int strcmp(char *s1, char *s2);
#ifdef UARTUSB_ENABLED #ifdef UARTUSB_ENABLED
# include "usb_uart.h" # include <sys/usb_uart.h>
#endif #endif
#ifdef GPIO_ENABLED #ifdef GPIO_ENABLED
# include "gpio.h" # include <sys/gpio.h>
#endif #endif
#ifdef ADC_ENABLED #ifdef ADC_ENABLED
# include "adc.h" # include <sys/adc.h>
#endif #endif
#ifdef SPI_ENABLED #ifdef SPI_ENABLED
# include "spi.h" # include <sys/spi.h>
#endif #endif
#ifdef GLCD_ENABLED #ifdef GLCD_ENABLED
# include "glcd.h" # include <sys/glcd.h>
#endif #endif
#ifdef PWM_ENABLED #ifdef PWM_ENABLED
# include "pwm.h" # include <sys/pwm.h>
#endif #endif
#ifdef PICGA_ENABLED #ifdef PICGA_ENABLED
# include "picga.h" # include <sys/picga.h>
#endif #endif
#ifdef PTY_ENABLED #ifdef PTY_ENABLED
# include "pty.h" # include <sys/pty.h>
#endif #endif
#ifdef HX8357_ENABLED #ifdef HX8357_ENABLED
# include "hx8357.h" # include <sys/hx8357.h>
#endif #endif
#ifdef SKEL_ENABLED #ifdef SKEL_ENABLED
# include "skel.h" # include <sys/skel.h>
#endif #endif
/* /*

View File

@@ -3,15 +3,15 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "signalvar.h" #include <sys/signalvar.h>
#include "systm.h" #include <sys/systm.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "vm.h" #include <sys/vm.h>
#include "uart.h" #include <sys/uart.h>
#include "usb_uart.h" #include <sys/usb_uart.h>
#include "debug.h" #include <sys/debug.h>
//#define TRACE_EXCEPTIONS //#define TRACE_EXCEPTIONS

View File

@@ -71,7 +71,6 @@ pic32/signal.c standard
pic32/skel.c optional skel pic32/skel.c optional skel
pic32/spi.c optional spi pic32/spi.c optional spi
pic32/spi_bus.c optional spi pic32/spi_bus.c optional spi
pic32/startup.S standard
pic32/swap.c standard pic32/swap.c standard
pic32/sysctl.c standard pic32/sysctl.c standard
pic32/uart.c optional uart pic32/uart.c optional uart

View File

@@ -21,14 +21,14 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "systm.h" #include <sys/systm.h>
#include "sys/uio.h" #include <sys/uio.h>
#include "glcd.h" #include <sys/glcd.h>
#include "debug.h" #include <sys/debug.h>
const struct devspec glcddevs[] = { const struct devspec glcddevs[] = {
{ 0, "glcd0" }, { 0, "glcd0" },

View File

@@ -21,13 +21,13 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "gpio.h" #include <sys/gpio.h>
#include "systm.h" #include <sys/systm.h>
#include "uio.h" #include <sys/uio.h>
const struct devspec gpiodevs[] = { const struct devspec gpiodevs[] = {
{ 0, "porta" }, { 1, "portb" }, { 2, "portc" }, { 3, "portd" }, { 0, "porta" }, { 1, "portb" }, { 2, "portc" }, { 3, "portd" },

View File

@@ -21,17 +21,16 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "systm.h" #include <sys/systm.h>
#include "uio.h" #include <sys/uio.h>
#include "adc.h" #include <sys/adc.h>
#include "debug.h" #include <sys/debug.h>
#include "hx8357.h" #include <sys/hx8357.h>
#include <sys/fonts/default.h>
#include "fonts/default.h"
char frame[40][80]; char frame[40][80];

View File

@@ -3,32 +3,32 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "dir.h" #include <sys/dir.h>
#include "inode.h" #include <sys/inode.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "fs.h" #include <sys/fs.h>
#include "map.h" #include <sys/map.h>
#include "buf.h" #include <sys/buf.h>
#include "file.h" #include <sys/file.h>
#include "clist.h" #include <sys/clist.h>
#include "callout.h" #include <sys/callout.h>
#include "reboot.h" #include <sys/reboot.h>
#include "msgbuf.h" #include <sys/msgbuf.h>
#include "namei.h" #include <sys/namei.h>
#include "mount.h" #include <sys/mount.h>
#include "systm.h" #include <sys/systm.h>
#include "debug.h" #include <sys/debug.h>
#include "uart.h" #include <sys/uart.h>
#include "usb_uart.h" #include <sys/usb_uart.h>
#ifdef UARTUSB_ENABLED #ifdef UARTUSB_ENABLED
# include <machine/usb_device.h> # include <machine/usb_device.h>
# include <machine/usb_function_cdc.h> # include <machine/usb_function_cdc.h>
#endif #endif
#ifdef HX8357_ENABLED #ifdef HX8357_ENABLED
#include "hx8357.h" #include <sys/hx8357.h>
#endif #endif
#ifdef POWER_ENABLED #ifdef POWER_ENABLED
@@ -147,9 +147,15 @@ nodump(dev)
int (*dump)(dev_t) = nodump; int (*dump)(dev_t) = nodump;
dev_t rootdev, swapdev, pipedev; #ifdef CONFIG
/*
* Build using old configuration utility (configsys).
*/
dev_t rootdev = NODEV;
dev_t swapdev = NODEV;
dev_t dumpdev = NODEV; dev_t dumpdev = NODEV;
#endif
dev_t pipedev;
daddr_t dumplo = (daddr_t) 1024; daddr_t dumplo = (daddr_t) 1024;
/* /*

View File

@@ -7,3 +7,6 @@ unix.bin
unix.map unix.map
usbboot.map usbboot.map
vers.c vers.c
*.h
ioconf.c
swapunix.c

View File

@@ -9,43 +9,30 @@
# #
machine "pic32" machine "pic32"
cpu "PIC32MX" cpu "PIC32MX7"
ident CHIPKIT_MAX ident CHIPKIT_MAX
# Linker script # Linker script
ldscript "pic32/bootloader-max32.ld" ldscript "cfg/bootloader-max32.ld"
# Need to set locally # Need to set locally
timezone 8 dst timezone 8 dst
maxusers 2 maxusers 2
# Standard system options # Standard system options
#options "CONFIG=MAX32" # TODO
options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "CPU_KHZ=80000" # Oscillator frequency of CPU core
options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_KHZ=80000" # Frequency of peripheral bus
options "HZ=100" # Rate of clock interrupt options "HZ=100" # Rate of clock interrupt
#???options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
#???options "CRYSTAL=8" # PLL input frequency in MHz
#???options "CPU_IDIV=2" # PLL input divisor 1/2/3/4/5/6/10/12
#???options "CPU_ODIV=1" # PLL output divisor 1/2/4/8/16/32/64/256
#???options "CPU_MUL=20" # PLL multiplier 15/16/17/18/19/20/21/24
options "EXEC_AOUT" # Run a.out binaries options "EXEC_AOUT" # Run a.out binaries
options "EXEC_ELF" # Run ELF binaries options "EXEC_ELF" # Run ELF binaries
options "EXEC_SCRIPT" # Run shell scripts options "EXEC_SCRIPT" # Run shell scripts
options "UCB_METER" # Collect kernel statistics options "UCB_METER" # Collect kernel statistics
# LEDs # LED
#options "LED_DISK_PORT=TRISF" # for disk activity LED... options "LED_KERNEL_PORT=TRISA" # for kernel actibity LED...
#options "LED_DISK_PIN=0" # ...use pin RF0 options "LED_KERNEL_PIN=3" # ...use pin RA3
#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 # Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a config unix root on sd0a
@@ -57,7 +44,10 @@ device uart1 # Serial-to-USB converter
device uart2 device uart2
device uart3 device uart3
device uart4 device uart4
options "UART_ENABLED" # TODO: delete this option options "UART1_ENABLED" # TODO: delete this option
options "UART2_ENABLED" # TODO: delete this option
options "UART3_ENABLED" # TODO: delete this option
options "UART4_ENABLED" # TODO: delete this option
# Console options # Console options
options "CONSOLE_DEVICE=tty0" # /dev/tty0 options "CONSOLE_DEVICE=tty0" # /dev/tty0
@@ -88,5 +78,5 @@ device pwm0
options "PWM_ENABLED" # TODO: delete this option options "PWM_ENABLED" # TODO: delete this option
# Skeleton driver # Skeleton driver
device skel0 #device skel0
options "SKEL_ENABLED" # TODO: delete this option #options "SKEL_ENABLED" # TODO: delete this option

View File

@@ -1,51 +1,367 @@
BUILDPATH = ../../../tools/configsys/../../sys/pic32 IDENT=-DCHIPKIT_MAX -DPIC32MX7 -DPWM_ENABLED -DADC_ENABLED -DGPIO_ENABLED -DSD0_CS_PIN=14 -DSD0_CS_PORT=TRISC -DSD0_PORT=2 -DSD0_MHZ=10 -DSPI_ENABLED -DCONSOLE_DEVICE=tty0 -DUART4_ENABLED -DUART3_ENABLED -DUART2_ENABLED -DUART1_ENABLED -DLED_KERNEL_PIN=3 -DLED_KERNEL_PORT=TRISA -DUCB_METER -DEXEC_SCRIPT -DEXEC_ELF -DEXEC_AOUT -DBUS_DIV=1 -DHZ=100 -DBUS_KHZ=80000 -DCPU_KHZ=80000
H = ../../../tools/configsys/../../sys/include LDSCRIPT="cfg/bootloader-max32.ld"
M = ../../../tools/configsys/../../sys/pic32 PARAM=-DTIMEZONE=480 -DDST=1 -DMAXUSERS=2
S = ../../../tools/configsys/../../sys/kernel #
# Makefile for RetroBSD, pic32 target
#
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
# PROF is set to -pg by kconfig if profiling is requested (kconfig -p).
vpath %.c $(M):$(S) ifndef MIPS_GCC_ROOT
vpath %.S $(M):$(S) ifeq (/usr/local/mips-2014.05,$(wildcard /usr/local/mips-2014.05))
MIPS_GCC_ROOT = /usr/local/mips-2014.05
endif
ifeq (/usr/local/mips-gcc-4.8.1,$(wildcard /usr/local/mips-gcc-4.8.1))
MIPS_GCC_ROOT = /usr/local/mips-gcc-4.8.1
endif
ifeq (/usr/local/pic32-tools,$(wildcard /usr/local/pic32-tools))
MIPS_GCC_ROOT = /usr/local/pic32-tools
endif
ifdef UECIDE
MIPS_GCC_ROOT = ${UECIDE}/compilers/pic32-tools
endif
endif
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.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 ifeq (${MIPS_GCC_ROOT}/bin/mips-sde-elf-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/mips-sde-elf-gcc))
EXTRA_TARGETS = MIPS_GCC_PREFIX ?= ${MIPS_GCC_ROOT}/bin/mips-sde-elf-
endif
ifeq (${MIPS_GCC_ROOT}/bin/mips-elf-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/mips-elf-gcc))
MIPS_GCC_PREFIX ?= ${MIPS_GCC_ROOT}/bin/mips-elf-
endif
ifeq (${MIPS_GCC_ROOT}/bin/pic32-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/pic32-gcc))
MIPS_GCC_PREFIX ?= ${MIPS_GCC_ROOT}/bin/pic32-
endif
DEFS += -DADC_ENABLED=YES AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
DEFS += -DBUS_DIV=1 CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
DEFS += -DBUS_KHZ=80000 CPP = ${MIPS_GCC_PREFIX}cpp
DEFS += -DCONSOLE_DEVICE=tty0 LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
DEFS += -DCPU_IDIV=2 LDFLAGS = -nostdlib -T $S/pic32/${LDSCRIPT} -Wl,-Map=unix.map
DEFS += -DCPU_KHZ=80000 SIZE = ${MIPS_GCC_PREFIX}size
DEFS += -DCPU_MUL=20 OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
DEFS += -DCPU_ODIV=1 OBJDUMP = ${MIPS_GCC_PREFIX}objdump
DEFS += -DCRYSTAL=8
DEFS += -DEXEC_AOUT
DEFS += -DEXEC_ELF
DEFS += -DEXEC_SCRIPT
DEFS += -DGPIO_ENABLED=YES
DEFS += -DKERNEL
DEFS += -DLED_KERNEL_PIN=3
DEFS += -DLED_KERNEL_PORT=TRISA
DEFS += -DPIC32MX7
DEFS += -DPWM_ENABLED=YES
DEFS += -DSD0_CS_PIN=14
DEFS += -DSD0_CS_PORT=TRISC
DEFS += -DSD0_MHZ=10
DEFS += -DSD0_PORT=2
DEFS += -DSPI_ENABLED=YES
DEFS += -DUART1_BAUD=115200
DEFS += -DUART1_ENABLED=YES
DEFS += -DUART2_BAUD=115200
DEFS += -DUART2_ENABLED=YES
DEFS += -DUART3_BAUD=115200
DEFS += -DUART3_ENABLED=YES
DEFS += -DUART4_BAUD=115200
DEFS += -DUART4_ENABLED=YES
DEFS += -DUCB_METER
ifeq (${MIPS_GCC_ROOT}/bin/mips-elf-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/mips-elf-gcc))
LDFLAGS += -Wl,--oformat=elf32-littlemips
endif
ifeq (${MIPS_GCC_ROOT}/bin/pic32-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/pic32-gcc))
LDFLAGS += -Wl,--oformat=elf32-tradlittlemips
endif
LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-max32.ld # source tree is located via $S relative to the compilation directory
S = ../..
CONFIG = MAX32 COPTS = -I. ${IDENT} -DKERNEL
CONFIGPATH = ../../../tools/configsys CFLAGS = -O ${COPTS}
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
# is marked as config-dependent.
NORMAL_C = ${CC} -c ${CFLAGS} ${PROF} $<
NORMAL_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
DRIVER_C = ${CC} -c ${CFLAGS} ${PROF} $<
DRIVER_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
PROFILE_C = ${CC} -p -c ${COPTS} $<
NORMAL_S = ${CC} -c ${COPTS} $<
NORMAL_S_C = ${CC} -c ${COPTS} ${PARAM} $<
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 swapunix.c machine sys ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh $S/pic32/newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
${SYSTEM_LD} swapunix.o
${SYSTEM_LD_TAIL}
swapunix.o: swapunix.c
${NORMAL_C}
all: unix.elf
clean:
rm -f *.elf *.o *.map *.dis *.bin
clean-all: clean
rm -f *.h *.c machine sys
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
load: unix.elf
pic32prog unix.hex
startup.o: $S/pic32/startup.S
${NORMAL_S}
# the following are necessary because the files depend on the types of
# cpu's included in the system configuration
clock.o machdep.o conf.o: Makefile
machine:
ln -s $S/pic32 $@
sys:
ln -s $S/include $@
depend: machine
mkdep ${COPTS} ${CFILES} ioconf.c
ioconf.o: ioconf.c
${CC} -c ${CFLAGS} ioconf.c
exec_aout.o: $S/kernel/exec_aout.c
${NORMAL_C}
exec_conf.o: $S/kernel/exec_conf.c
${NORMAL_C}
exec_elf.o: $S/kernel/exec_elf.c
${NORMAL_C}
exec_script.o: $S/kernel/exec_script.c
${NORMAL_C}
exec_subr.o: $S/kernel/exec_subr.c
${NORMAL_C}
init_main.o: $S/kernel/init_main.c
${NORMAL_C}
init_sysent.o: $S/kernel/init_sysent.c
${NORMAL_C}
kern_clock.o: $S/kernel/kern_clock.c
${NORMAL_C}
kern_descrip.o: $S/kernel/kern_descrip.c
${NORMAL_C}
kern_exec.o: $S/kernel/kern_exec.c
${NORMAL_C}
kern_exit.o: $S/kernel/kern_exit.c
${NORMAL_C}
kern_fork.o: $S/kernel/kern_fork.c
${NORMAL_C}
kern_mman.o: $S/kernel/kern_mman.c
${NORMAL_C}
kern_proc.o: $S/kernel/kern_proc.c
${NORMAL_C}
kern_prot.o: $S/kernel/kern_prot.c
${NORMAL_C}
kern_prot2.o: $S/kernel/kern_prot2.c
${NORMAL_C}
kern_resource.o: $S/kernel/kern_resource.c
${NORMAL_C}
kern_sig.o: $S/kernel/kern_sig.c
${NORMAL_C}
kern_sig2.o: $S/kernel/kern_sig2.c
${NORMAL_C}
kern_subr.o: $S/kernel/kern_subr.c
${NORMAL_C}
kern_synch.o: $S/kernel/kern_synch.c
${NORMAL_C}
kern_sysctl.o: $S/kernel/kern_sysctl.c
${NORMAL_C}
kern_time.o: $S/kernel/kern_time.c
${NORMAL_C}
rdisk.o: $S/kernel/rdisk.c
${NORMAL_C}
subr_prf.o: $S/kernel/subr_prf.c
${NORMAL_C}
subr_rmap.o: $S/kernel/subr_rmap.c
${NORMAL_C}
sys_generic.o: $S/kernel/sys_generic.c
${NORMAL_C}
sys_inode.o: $S/kernel/sys_inode.c
${NORMAL_C}
sys_pipe.o: $S/kernel/sys_pipe.c
${NORMAL_C}
sys_process.o: $S/kernel/sys_process.c
${NORMAL_C}
syscalls.o: $S/kernel/syscalls.c
${NORMAL_C}
tty.o: $S/kernel/tty.c
${NORMAL_C}
tty_subr.o: $S/kernel/tty_subr.c
${NORMAL_C}
tty_tty.o: $S/kernel/tty_tty.c
${NORMAL_C}
ufs_alloc.o: $S/kernel/ufs_alloc.c
${NORMAL_C}
ufs_bio.o: $S/kernel/ufs_bio.c
${NORMAL_C}
ufs_bmap.o: $S/kernel/ufs_bmap.c
${NORMAL_C}
ufs_dsort.o: $S/kernel/ufs_dsort.c
${NORMAL_C}
ufs_fio.o: $S/kernel/ufs_fio.c
${NORMAL_C}
ufs_inode.o: $S/kernel/ufs_inode.c
${NORMAL_C}
ufs_mount.o: $S/kernel/ufs_mount.c
${NORMAL_C}
ufs_namei.o: $S/kernel/ufs_namei.c
${NORMAL_C}
ufs_subr.o: $S/kernel/ufs_subr.c
${NORMAL_C}
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
${NORMAL_C}
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
${NORMAL_C}
vfs_vnops.o: $S/kernel/vfs_vnops.c
${NORMAL_C}
vm_sched.o: $S/kernel/vm_sched.c
${NORMAL_C}
vm_swap.o: $S/kernel/vm_swap.c
${NORMAL_C}
vm_swp.o: $S/kernel/vm_swp.c
${NORMAL_C}
adc.o: $S/pic32/adc.c
${NORMAL_C}
clock.o: $S/pic32/clock.c
${NORMAL_C}
cons.o: $S/pic32/cons.c
${NORMAL_C}
devsw.o: $S/pic32/devsw.c
${NORMAL_C}
exception.o: $S/pic32/exception.c
${NORMAL_C}
gpio.o: $S/pic32/gpio.c
${NORMAL_C}
machdep.o: $S/pic32/machdep.c
${NORMAL_C}
mem.o: $S/pic32/mem.c
${NORMAL_C}
pwm.o: $S/pic32/pwm.c
${NORMAL_C}
rd_sd.o: $S/pic32/rd_sd.c
${NORMAL_C}
signal.o: $S/pic32/signal.c
${NORMAL_C}
spi.o: $S/pic32/spi.c
${NORMAL_C}
spi_bus.o: $S/pic32/spi_bus.c
${NORMAL_C}
swap.o: $S/pic32/swap.c
${NORMAL_C}
sysctl.o: $S/pic32/sysctl.c
${NORMAL_C}
uart.o: $S/pic32/uart.c
${NORMAL_C}
include ../../../tools/configsys/../../sys/pic32/kernel-post.mk

View File

@@ -3,11 +3,11 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "conf.h" #include <sys/conf.h>
#include "systm.h" #include <sys/systm.h>
#include "uio.h" #include <sys/uio.h>
const struct devspec mmdevs[] = { const struct devspec mmdevs[] = {
{ 0, "mem" }, { 0, "mem" },

View File

@@ -21,16 +21,15 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include <sys/param.h>
#include "param.h" #include <sys/conf.h>
#include "conf.h" #include <sys/user.h>
#include "user.h" #include <sys/ioctl.h>
#include "ioctl.h" #include <sys/systm.h>
#include "systm.h" #include <sys/uio.h>
#include "uio.h" #include <sys/picga.h>
#include "picga.h" #include <sys/spi_bus.h>
#include "spi_bus.h" #include <sys/debug.h>
#include "debug.h"
const struct devspec picgadevs[] = { const struct devspec picgadevs[] = {
{ 0, "picga" }, { 0, "picga" },
@@ -45,7 +44,7 @@ void blockdelay(unsigned int v)
{ {
for( ; v>0 ; v--) for( ; v>0 ; v--)
asm volatile ("nop"); asm volatile ("nop");
} }
void picga_command(unsigned char cmd, unsigned char len, void *data) void picga_command(unsigned char cmd, unsigned char len, void *data)
{ {

View File

@@ -1,9 +1,9 @@
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "systm.h" #include <sys/systm.h>
#include "machparam.h" #include <sys/machparam.h>
#include "reboot.h" #include <sys/reboot.h>
volatile unsigned int psCounter; volatile unsigned int psCounter;
int countdown; int countdown;

View File

@@ -22,14 +22,14 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "systm.h" #include <sys/systm.h>
#include "sys/uio.h" #include <sys/uio.h>
#include "pwm.h" #include <sys/pwm.h>
#include "debug.h" #include <sys/debug.h>
/* /*
* Devices: * Devices:

View File

@@ -1,9 +1,9 @@
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "buf.h" #include <sys/buf.h>
#include "errno.h" #include <sys/errno.h>
#include "dk.h" #include <sys/dk.h>
#include "debug.h" #include <sys/debug.h>
extern unsigned char flash_data[] asm("_binary_flash_img_start"); extern unsigned char flash_data[] asm("_binary_flash_img_start");
extern unsigned char flash_data_size[] asm("_binary_flash_img_size"); extern unsigned char flash_data_size[] asm("_binary_flash_img_size");

View File

@@ -1,12 +1,11 @@
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "buf.h" #include <sys/buf.h>
#include "errno.h" #include <sys/errno.h>
#include "dk.h" #include <sys/dk.h>
#include "rdisk.h" #include <sys/rdisk.h>
#include "spi_bus.h" #include <sys/spi_bus.h>
#include <sys/debug.h>
#include "debug.h"
#define MRAM_WREN 0x06 #define MRAM_WREN 0x06
#define MRAM_WRDI 0x04 #define MRAM_WRDI 0x04

View File

@@ -29,15 +29,14 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "buf.h" #include <sys/buf.h>
#include "errno.h" #include <sys/errno.h>
#include "dk.h" #include <sys/dk.h>
#include "rdisk.h" #include <sys/rdisk.h>
#include "spi_bus.h" #include <sys/spi_bus.h>
#include <sys/debug.h>
#include "debug.h"
/* /*
* Two SD/MMC disks on SPI. * Two SD/MMC disks on SPI.

View File

@@ -5,20 +5,19 @@
* *
* This code could use a bit of optimization. * This code could use a bit of optimization.
*/ */
#include <sys/param.h>
#include "param.h" #include <sys/systm.h>
#include "systm.h" #include <sys/buf.h>
#include "buf.h" #include <sys/errno.h>
#include "errno.h" #include <sys/dk.h>
#include "dk.h" #include <sys/sdram.h>
#include "sdram.h" #include <sys/rd_sdramp.h>
#include "rd_sdramp.h" #include <sys/rdisk.h>
#include "rdisk.h"
/* /*
* See rd_sdramp_config.h for sdramp port/pin configuration * See rd_sdramp_config.h for sdramp port/pin configuration
*/ */
#include "rd_sdramp_config.h" #include <machine/rd_sdramp_config.h>
int sw_dkn = -1; /* Statistics slot number */ int sw_dkn = -1; /* Statistics slot number */

View File

@@ -1,12 +1,11 @@
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "buf.h" #include <sys/buf.h>
#include "errno.h" #include <sys/errno.h>
#include "dk.h" #include <sys/dk.h>
#include "rdisk.h" #include <sys/rdisk.h>
#include "spi_bus.h" #include <sys/spi_bus.h>
#include <sys/debug.h>
#include "debug.h"
#define SPIRAM_WREN 0x06 #define SPIRAM_WREN 0x06
#define SPIRAM_WRDI 0x04 #define SPIRAM_WRDI 0x04

View File

@@ -16,14 +16,13 @@
* Signals PMRD, PMWR are active LOW and idle HIGH * Signals PMRD, PMWR are active LOW and idle HIGH
* Signal PMA0 is LOW when accessing RAM Data, and HIGH when accessing RAM Addresses * Signal PMA0 is LOW when accessing RAM Data, and HIGH when accessing RAM Addresses
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "buf.h" #include <sys/buf.h>
#include "errno.h" #include <sys/errno.h>
#include "dk.h" #include <sys/dk.h>
#include "rdisk.h" #include <sys/rdisk.h>
#include <sys/debug.h>
#include "debug.h"
int sw_dkn = -1; /* Statistics slot number */ int sw_dkn = -1; /* Statistics slot number */

View File

@@ -15,7 +15,7 @@
/* /*
* See rd_sdramp_config.h for sdramp port/pin configuration * See rd_sdramp_config.h for sdramp port/pin configuration
*/ */
#include "rd_sdramp_config.h" #include <machine/rd_sdramp_config.h>
/* Offsets (from TRISA) for the various port control registers */ /* Offsets (from TRISA) for the various port control registers */
#define TRIS_OFFSET 0x0 #define TRIS_OFFSET 0x0

View File

@@ -3,14 +3,14 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "systm.h" #include <sys/systm.h>
#include "signalvar.h" #include <sys/signalvar.h>
#include "user.h" #include <sys/user.h>
#include "proc.h" #include <sys/proc.h>
#include "buf.h" #include <sys/buf.h>
#include "map.h" #include <sys/map.h>
#include "syslog.h" #include <sys/syslog.h>
//#define DIAGNOSTIC //#define DIAGNOSTIC

View File

@@ -21,13 +21,13 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "systm.h" #include <sys/systm.h>
#include "uio.h" #include <sys/uio.h>
#include "skel.h" #include <sys/skel.h>
/* /*
* List of device names and minor numbers. * List of device names and minor numbers.

View File

@@ -21,14 +21,14 @@
* arising out of or in connection with the use or performance of * arising out of or in connection with the use or performance of
* this software. * this software.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "systm.h" #include <sys/systm.h>
#include "uio.h" #include <sys/uio.h>
#include "spi.h" #include <sys/spi.h>
#include "spi_bus.h" #include <sys/spi_bus.h>
const struct devspec spidevs[] = { const struct devspec spidevs[] = {
{ 0, "spi1" }, { 0, "spi1" },

View File

@@ -1,10 +1,10 @@
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "systm.h" #include <sys/systm.h>
#include "uio.h" #include <sys/uio.h>
#include "spi_bus.h" #include <sys/spi_bus.h>
#define NSPI 4 /* Ports SPI1...SPI4 */ #define NSPI 4 /* Ports SPI1...SPI4 */

View File

@@ -28,7 +28,7 @@
* Sean Justice 15_Sept-2008 First release * Sean Justice 15_Sept-2008 First release
* Anton Alkhimenok 06_Jun-2009 Ported to PIC24 * Anton Alkhimenok 06_Jun-2009 Ported to PIC24
*/ */
#include "ssd1926.h" #include <machine/ssd1926.h>
/* /*
* Helper Macros * Helper Macros

View File

@@ -22,7 +22,7 @@
# arising out of or in connection with the use or performance of # arising out of or in connection with the use or performance of
# this software. # this software.
# #
#include "machine/io.h" #include <machine/io.h>
#define UBASE 0x7f008000 /* User space base address */ #define UBASE 0x7f008000 /* User space base address */

View File

@@ -2,18 +2,17 @@
* Simple proxy for swap partition. Forwards requests for /dev/swap on to the * Simple proxy for swap partition. Forwards requests for /dev/swap on to the
* device specified by swapdev * device specified by swapdev
*/ */
#include <sys/param.h>
#include "param.h" #include <sys/systm.h>
#include "systm.h" #include <sys/buf.h>
#include "buf.h" #include <sys/errno.h>
#include "errno.h" #include <sys/dk.h>
#include "dk.h" #include <sys/uio.h>
#include "uio.h" #include <sys/conf.h>
#include "conf.h" #include <sys/fcntl.h>
#include "fcntl.h" #include <sys/map.h>
#include "map.h" #include <sys/swap.h>
#include "swap.h" #include <sys/rdisk.h>
#include "rdisk.h"
#ifndef NTMP #ifndef NTMP
#define NTMP 3 #define NTMP 3

View File

@@ -3,24 +3,24 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "proc.h" #include <sys/proc.h>
#include "kernel.h" #include <sys/kernel.h>
#include "file.h" #include <sys/file.h>
#include "inode.h" #include <sys/inode.h>
#include "sysctl.h" #include <sys/sysctl.h>
#include "cpu.h" #include <machine/cpu.h>
#include "tty.h" #include <sys/tty.h>
#include "systm.h" #include <sys/systm.h>
#include "dk.h" #include <sys/dk.h>
#include "vmsystm.h" #include <sys/vmsystm.h>
#include "ptrace.h" #include <sys/ptrace.h>
#include "namei.h" #include <sys/namei.h>
#include "vmmeter.h" #include <sys/vmmeter.h>
#include "map.h" #include <sys/map.h>
#include "conf.h" #include <sys/conf.h>
/* /*
* Errno messages. * Errno messages.

View File

@@ -5,13 +5,13 @@
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution. * specifies the terms and conditions for redistribution.
*/ */
#include "param.h" #include <sys/param.h>
#include "conf.h" #include <sys/conf.h>
#include "user.h" #include <sys/user.h>
#include "ioctl.h" #include <sys/ioctl.h>
#include "tty.h" #include <sys/tty.h>
#include "systm.h" #include <sys/systm.h>
#include "uart.h" #include <sys/uart.h>
#define CONCAT(x,y) x ## y #define CONCAT(x,y) x ## y
#define BBAUD(x) CONCAT(B,x) #define BBAUD(x) CONCAT(B,x)

View File

@@ -92,7 +92,6 @@ usage: fputs("usage: kconfig [-gp] sysname\n", stderr);
makefile(); /* build Makefile */ makefile(); /* build Makefile */
headers(); /* make a lot of .h files */ headers(); /* make a lot of .h files */
swapconf(); /* swap config files */ swapconf(); /* swap config files */
printf("Don't forget to run \"make depend\"\n");
exit(0); exit(0);
} }

View File

@@ -93,6 +93,13 @@ do_swap(fl)
fprintf(fp, "dev_t\tdumpdev = makedev(%d, %d);\t/* %s */\n", fprintf(fp, "dev_t\tdumpdev = makedev(%d, %d);\t/* %s */\n",
major(fl->f_dumpdev), minor(fl->f_dumpdev), major(fl->f_dumpdev), minor(fl->f_dumpdev),
devtoname(fl->f_dumpdev)); devtoname(fl->f_dumpdev));
#if 1
/* Only one swap device is supported. */
dev = swap->f_swapdev;
fprintf(fp, "dev_t\tswapdev = makedev(%d, %d);\t/* %s */\n",
major(swap->f_swapdev), minor(swap->f_swapdev),
devtoname(swap->f_swapdev));
#else
fprintf(fp, "\n"); fprintf(fp, "\n");
fprintf(fp, "struct\tswdevt swdevt[] = {\n"); fprintf(fp, "struct\tswdevt swdevt[] = {\n");
do { do {
@@ -104,6 +111,7 @@ do_swap(fl)
} while (swap && swap->f_type == SWAPSPEC); } while (swap && swap->f_type == SWAPSPEC);
fprintf(fp, "\t{ NODEV, 0, 0 }\n"); fprintf(fp, "\t{ NODEV, 0, 0 }\n");
fprintf(fp, "};\n"); fprintf(fp, "};\n");
#endif
fclose(fp); fclose(fp);
return (swap); return (swap);
} }