RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sun Mar 29, 2020 11:27 am

All times are UTC




Post new topic Reply to topic  [ 192 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next
Author Message
PostPosted: Wed Nov 26, 2014 6:53 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Finally the kernel runs more or less stable. I've also updated the filesystem stuff to be compatible with modern BSD variants.
Code:
OVPsim (32-Bit) v20140731.0 Open Virtual Platform simulator from www.OVPworld.org.
Copyright (c) 2005-2014 Imperas Software Ltd.  Contains Imperas Proprietary Information.
Licensed Software, All Rights Reserved.
Visit www.IMPERAS.com for multicore debug, verification and analysis solutions.

OVPsim started: Tue Nov 25 22:18:35 2014


Card0 image '/local/BSD/Tilden/sdcard.img', 339969 kbytes
Load file: '/local/BSD/pic32sim/demo/wifire/boot.hex', 6916 bytes
Load file: '/local/BSD/Tilden/sys/compile/WIFIRE.pic32/vmunix.hex', 510024 bytes

***** Start 'microAptivP' *****
Copyright (c) 1982, 1986, 1989, 1991, 1993
   The Regents of the University of California.  All rights reserved.

4.4BSD-Lite build 16 compiled 2014-11-25
    sergev@ubuntu-sergev:Tilden/sys/compile/WIFIRE.pic32
cpu: PIC32MZ2048ECG100 rev A4, 200 MHz
oscillator: system PLL div 1:6 mult x50
real mem = 512 kbytes
avail mem = 344 kbytes
using 10 buffers containing 49152 bytes of memory
spi1 at pins sdi=F1/sdo=C1/sck=D1
spi2 at pins sdi=F0/sdo=D11/sck=G6
spi3 at pins sdi=B10/sdo=C4/sck=B14
spi4 at pins sdi=F5/sdo=G0/sck=D10
uart1 at pins rx=D14/tx=D15, interrupts 112/113/114
uart4 at pins rx=F2/tx=F8, interrupts 170/171/172, console
sd0 at port spi3, pin cs=C3
sd0: type I, size 679936 kbytes, speed 12 Mbit/sec
sd0a: partition type b7, sector 2, size 204800 kbytes
sd0b: partition type b8, sector 409602, size 32768 kbytes
sd0c: partition type b7, sector 475138, size 102400 kbytes
bpf: lo0 attached
WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!

Automatic boot in progress: starting file system checks.
/dev/rsd0a: file system is clean; not checking
/dev/rsd0c: file system is clean; not checking
starting network
starting system logger.
creating passwd database
clearing /tmp
standard daemons: update.
Tue Nov 25 22:16:09 PST 2014


4.4BSD-Lite (bsd.net) (tty4)

login: root
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.   All rights reserved.

4.4BSD-Lite UNIX #1: Fri Apr 01 00:00:00 PDT 1994

Welcome to 4.4BSD-Lite!

erase ^H, kill ^U, intr ^C status ^T
Don't login as root, use the su command.
# ps alx
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT TT       TIME COMMAND
    0     0     0   0 -18  0     0    0 schedu DLs  ??    0:00.00 (swapper)
    0     1     0   0  10  0   172    0 wait   Ss   ??    0:00.00 /sbin/init
    0     2     0   0 -18  0     0    0 -      RL   ??    0:00.65 (pagedaemon)
    0    21     1   0   2  0   144    0 select Ss   ??    0:00.00 syslogd
    0    32     1   0  18  0    20    0 pause  SWs  ??    0:00.00 update
    0    39     1   0  10  0   332    0 wait   Ss    4    0:00.00 -sh (sh)
    0    41    39   0  28  0   200    0 -      R+    4    0:00.00 (ps)
# _

Detailed information about kernel can be obtained via sysctl utility:
Code:
# sysctl -a
kern.ostype = 4.4BSD
kern.osrelease = 4.4BSD-Lite
kern.osrevision = 199506
kern.version = 4.4BSD-Lite build 16 compiled 2014-11-25
    sergev@ubuntu-sergev:Tilden/sys/compile/WIFIRE.pic32

kern.maxvnodes = 54
kern.maxproc = 24
kern.maxfiles = 64
kern.argmax = 4096
kern.securelevel = 1
kern.hostname = bsd.net
kern.hostid = 0
kern.clockrate: hz = 20, tick = 50000, profhz = 20, stathz = 20
kern.posix1version = 198808
kern.ngroups = 16
kern.job_control = 1
kern.saved_ids = 0
kern.boottime = Tue Nov 25 22:16:09 2014

vm.loadavg: 0.07 0.02 0.01
vfs.ufs has 1 mounted instance
net.inet.ip.forwarding = 0
net.inet.ip.redirect = 1
net.inet.ip.ttl = 64
net.inet.icmp.maskrepl = 0
net.inet.udp.checksum = 1
debug.syncprt = 0
debug.busyprt = 0
debug.lockpausetime = 0
hw.machine = MIPS
hw.model = PIC32MZ2048ECG100
hw.ncpu = 1
hw.byteorder = 1234
hw.physmem = 524288
hw.usermem = 348160
hw.pagesize = 4096
machdep.console_device = tty4
user.cs_path = /usr/bin:/bin:/usr/sbin:/sbin:/usr/contrib/bin:/usr/old/bin
user.bc_base_max = 99
user.bc_dim_max = 2048
user.bc_scale_max = 99
user.bc_string_max = 1000
user.coll_weights_max = 0
user.expr_nest_max = 32
user.line_max = 2048
user.re_dup_max = 255
user.posix2_version = 199212
user.posix2_c_bind = 0
user.posix2_c_dev = 0
user.posix2_char_term = 0
user.posix2_fort_dev = 0
user.posix2_fort_run = 0
user.posix2_localedef = 0
user.posix2_sw_dev = 0
user.posix2_upe = 0
user.stream_max = 20
user.tzname_max = 255


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 10:27 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Holy cow. I'm going to have to start investigating this on my WiFire, and then cross-post it on chipKIT!

Stirling work, sir!

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 1:04 pm 

Joined: Mon Nov 24, 2014 6:12 am
Posts: 13
Location: Australia
Congratulations, :) I'm going off to load it up and try it on the wifire.... beautiful!

Ray


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 1:19 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Serge,

MOST IMPRESSIVE.

Any reason to try to get A5 chip to run it on?

Any chip bugs evident yet?

Wiz


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 2:20 pm 

Joined: Mon Nov 24, 2014 1:07 pm
Posts: 58
Hi Serge,

Outstanding work! I've received my 3 samples of the PIC32MZ2048ECM144 the other day, I just need to produce a board for it along with a KSZ8873RLL to provide 2 ethernet sockets as though it were connected to an ethernet switch. If any one on here in the UK wants one of these mailled to them to play with on their own pcb design, let me know.

Again, great work Serge!!

Dan


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 2:46 pm 

Joined: Mon Nov 24, 2014 6:12 am
Posts: 13
Location: Australia
I've hit a small problem compiling, I suspect it is a simple makefile problem...

Everything is fine until it gets to the $HOME/Tilden/sys/libkern directory and then tries to compile with gcc, rather than the mips compiler..

/usr/local/mips-2014.05/bin/mips-sde-elf-gcc -mips32r2 -EL <snip> -c vnode_if.c
cd ../../libkern && pmake all
gcc -mips32r2 -EL <snip> -c adddi3.c
gcc: error: unrecognized command line option ‘-mips32r2’
gcc: error: unrecognized command line option ‘-EL’
*** Error code 1

Any Ideas? ( I've probably done something dumb :) )

Ray


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 4:26 pm 

Joined: Mon Nov 24, 2014 6:12 am
Posts: 13
Location: Australia
Compiles ok as follows.... just need to create a Makefile in ../../libkern

cd $BSDSRC/sys/libkern
bmake depend

cd $BSDSRC/sys/compile/WIFIRE.pic32
bmake depend
bmake

Ray


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 7:43 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Thanks, guys. You are welcome to join the project: it becomes interesting. Still a lot of work to do.

Ray,
It seems I fixed this issue: libkern actually required DESTDIR/include to be available. Now the kernel can be compiled independently of other stuff. See last commit: https://github.com/sergev/Tilden/commit/87f829027d1cc4397eeadffa9710922df6c2f990


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 1:03 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Is there a build howto of any form around so I can compile it?

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 1:52 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
I've updated the wiki page: https://github.com/sergev/Tilden/wiki/Build

Matt, do you have any plans to develop a board like SDXL, but MZ based?


Top
 Profile  
 
 Post subject: Binary release 0.1
PostPosted: Thu Nov 27, 2014 5:54 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
I created a binary package with kernel and SD card images.
This version was tested on real chipKIT Wi-Fire board.
http://vak.ru/pub/unix/4.4bsd-pic32mz-binaries-0.1.zip

All you need is to program the kernel into flash memory using pic32prog utility, and write sdcard.img to micro-SD card, for example:
Code:
$ sudo pic32prog -d /dev/ttyUSB0 vmunix.hex
$ sudo dd bs=32k if=sdcard.img of=/dev/sdc

The sources are available here: http://vak.ru/pub/unix/4.4bsd-pic32mz-sources-0.1.zip

By default, the system starts in multi-user mode. If you want to boot into single-user mode, hold button 1 pressed on reset.


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 7:55 am 

Joined: Mon Nov 24, 2014 6:12 am
Posts: 13
Location: Australia
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.

4.4BSD-Lite UNIX #1: Fri Apr 01 00:00:00 PDT 1994

Welcome to 4.4BSD-Lite!

No entry for terminal type "su"
using dumb terminal settings.
erase ^H, kill ^U, intr ^C status ^T
Don't login as root, use the su command.
# tail -f /var/log/messages
Nov 26 21:23:06 bsd vmunix: spi4 at pins sdi=F5/sdo=G0/sck=D10
Nov 26 21:23:06 bsd vmunix: uart1 at pins rx=D14/tx=D15, interrupts 112/113/114
Nov 26 21:23:06 bsd vmunix: uart4 at pins rx=F2/tx=F8, interrupts 170/171/172, console
Nov 26 21:23:06 bsd vmunix: sd0 at port spi3, pin cs=C3
Nov 26 21:23:06 bsd vmunix: sd0: type SDHC, size 15523840 kbytes, speed 12 Mbit/sec
Nov 26 21:23:06 bsd vmunix: sd0a: partition type b7, sector 2, size 204800 kbytes
Nov 26 21:23:06 bsd vmunix: sd0b: partition type b8, sector 409602, size 32768 kbytes
Nov 26 21:23:06 bsd vmunix: sd0c: partition type b7, sector 475138, size 102400 kbytes
Nov 26 21:23:06 bsd vmunix: bpf: lo0 attached
Nov 26 21:23:06 bsd vmunix: WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!


Looking good... I'm very grateful you put up the binary image of the sdcard, I was having problems getting it to compile everything..

Opens up a whole new world for PIC32MZ... :)

Ray


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 10:40 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
vak wrote:
I've updated the wiki page: https://github.com/sergev/Tilden/wiki/Build

Matt, do you have any plans to develop a board like SDXL, but MZ based?


Yes, I have one half designed. It's on the back burner though until the MZ chips become easier to get hold of as samples. My current samples are the 144 pin jobbies, and an SDZL board would need the little 64 pin ones.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 10:48 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
vak wrote:


The bmake alias isn't working:
Code:
matt@dell:~/git/Tilden$ bmake kernel
pmake -Cusr.sbin/config
usage: pmake [-BeikNnqrstWX] [-D variable] [-d flags] [-f makefile]
            [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]
            [-V variable] [variable=value] [target ...]
*** Error code 2

Stop.
pmake: stopped in /u2/home/matt/git/Tilden

I guess it's getting the make executable to use for make subprocesses, but losing the required -B flag from it in the process.

I've tried a little script to wrap pmake into bmake, but it does the same. I may try a little C program instead so it's a real executable.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 11:09 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Hum... no, that doesn't seem to work.

I think the main problem here is that my pmake doesn't have a -C flag for some reason.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 11:43 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Ok, so I have written a wrapper for my pmake, and that now works fine (attached, if anyone wants it). However, now I have problems compiling genassym:

Code:
matt@dell:~/git/Tilden$ bmake kernel
0: bmake
1: -B
2: kernel
(cd sys/mips/conf; ../../../usr.sbin/config/config -g WIFIRE.pic32)
Don't forget to run "make depend"
bmake -Csys/compile/WIFIRE.pic32 depend
Found change dir flag: -Csys/compile/WIFIRE.pic32
Change to: sys/compile/WIFIRE.pic32
0: bmake
1: -B
2: depend
gcc -m32 -g -nostdinc -fno-builtin -I. -I../.. -I. -DWIFIRE -DPIC32MZ -DINET -DPROCFS -DFDESC -DKERNFS -DUNION -DFFS -DFIFO -DCONS_MINOR=3 -DCONS_MAJOR=17 -DHZ=20 -DCPU_KHZ=200000 -DNMBCLUSTERS=16 -DNKMEMCLUSTERS=32 -DDEBUG -DDIAGNOSTIC -DDEVPAGER -DVNODEPAGER -DSWAPPAGER -DTIMEZONE=480 -DDST=1 -DMAXUSERS=2 -o genassym ../../mips/pic32/genassym.c
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
*** Error code 1

Stop.
bmake: stopped in /u2/home/matt/git/Tilden/sys/compile/WIFIRE.pic32
*** Error code 1

Stop.
bmake: stopped in /u2/home/matt/git/Tilden


Attachments:
bmake-wrapper.tar.gz [784 Bytes]
Downloaded 657 times

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 11:46 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Ok, drop the -m32 unless you have the full 32-bit compilation environment set up. Why is LOCALCC set up for 32-bit only anyway? Is there a good reason for it?

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 11:53 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Next problem seems to be libkern. It's executing the system gcc instead of the mips gcc, and I can't see why it would be running the mips gcc, since I can't find where it's being told to. It's makefile is just a stub, and that includes bsd.lib.mk, and that doesn't tell it to use mips GCC.

So what am I doing wrong now? Or is it my bmake stub not passing things through properly or something?

Edit: No, it''s not, because pmake from the kernel build directory does the exact same thing.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 12:00 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Ok, a few hacks and tweaks later (editing libkern's Makefile to set CC properly, flagging __mcount to be unused, and fixing some missing parameters around truth values), I have managed to build the kernel.

Don't know if it works yet though...

Nothing else compiles though, as it's all trying to use GCC instead of MIPS GCC.

There must be some obvious step that I missed...?

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 9:32 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Hi Matt,
Do you have MAKESYSPATH set properly?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 192 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission