RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sat Aug 08, 2020 3:24 pm

All times are UTC




Post new topic Reply to topic  [ 192 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9, 10  Next
Author Message
PostPosted: Wed Dec 10, 2014 10:16 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
You got it. You need both the MIPS compiler and the native compiler. There are (at least) two special programs that need compiling natively in order to build the system: config, for generating the kernel build files, and ufstool for building (and manipulating) the disk image.

Without those the build can't happen, and they're certainly not "normal" Linux applications, in that they aren't in any repositories anywhere (config is from BSD, and ufstool is written by our very own Serge), so they have to be compiled specially at build time.

A few tips on building that I have found:

To rebuild the whole filesystem you need to delete your ${DESTDIR} folder in its entirity - it's no good just doing a "bmake clean".

To update a program in the ${DESTDIR} after modifying it, you need to do a "bmake install" in that program's folder, or the parent folder (say "usr.bin") to place it in ${DESTDIR} - doing "bmake fs" won't do that as ${DESTDIR} already exists.

Compiling a single-file program generally just needs a two-line Makefile:
Code:
PROG=foo
.include <bsd.prog.mk>

That will compile foo.c into foo, and provide install, clean, etc. If the program has more than foo.c then you need one extra line:
Code:
PROG=foo
SRCS=foo.c bar.c
.include <bsd.prog.mk>


Compilation flags can be set with COPTS:
Code:
PROG=foo
SRCS=foo.c bar.c
COPTS=-DDEBUG -DTHIS_SETTING=43
.include <bsd.prog.mk>


There's a helluva lot more you can add to one of those Makefiles to do more things, but that's the two basic ones.

Happy tinkering.

_________________
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 Dec 10, 2014 4:18 pm 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
majenko wrote:
You got it. You need both the MIPS compiler and the native compiler. There are (at least) two special programs that need compiling natively in order to build the system: config, for generating the kernel build files, and ufstool for building (and manipulating) the disk image.

Without those the build can't happen, and they're certainly not "normal" Linux applications, in that they aren't in any repositories anywhere (config is from BSD, and ufstool is written by our very own Serge), so they have to be compiled specially at build time.


I eagerly await 4.4 being able to recompile itself on the PIC...in a week, with immense swapping. ;)

Quote:
A few tips on building that I have found:

To rebuild the whole filesystem you need to delete your ${DESTDIR} folder in its entirity - it's no good just doing a "bmake clean".

To update a program in the ${DESTDIR} after modifying it, you need to do a "bmake install" in that program's folder, or the parent folder (say "usr.bin") to place it in ${DESTDIR} - doing "bmake fs" won't do that as ${DESTDIR} already exists.

Compiling a single-file program generally just needs a two-line Makefile:
Code:
PROG=foo
.include <bsd.prog.mk>

That will compile foo.c into foo, and provide install, clean, etc. If the program has more than foo.c then you need one extra line:
Code:
PROG=foo
SRCS=foo.c bar.c
.include <bsd.prog.mk>


Compilation flags can be set with COPTS:
Code:
PROG=foo
SRCS=foo.c bar.c
COPTS=-DDEBUG -DTHIS_SETTING=43
.include <bsd.prog.mk>


There's a helluva lot more you can add to one of those Makefiles to do more things, but that's the two basic ones.

Happy tinkering.


Thank you! Were there any specific patches made to a bunch of the source files you've found? I tried to "port" some bits from the 4.4 and CSRG SCCS trees I have laying around, and they hit a bunch of undefined symbols.

SEEMINGLY string and maths-related I believe?


Top
 Profile  
 
PostPosted: Wed Dec 10, 2014 4:25 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
Not that I know of.

The main thing to watch is that by default -Wall is defined, so the slightest hiccup will make it b0rk. That means all assignments used as truth values need () around them, all unused variables need removing, all functions need proper prototypes, so the right headers including, etc. Just generally tidying up.

_________________
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 Dec 10, 2014 5:16 pm 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
majenko wrote:
Not that I know of.

The main thing to watch is that by default -Wall is defined, so the slightest hiccup will make it b0rk. That means all assignments used as truth values need () around them, all unused variables need removing, all functions need proper prototypes, so the right headers including, etc. Just generally tidying up.


That certainly provides easier pointers to code that DOES need cleaned up. ;)


Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 8:25 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
I eagerly await 4.4 being able to recompile itself on the PIC...in a week, with immense swapping. ;)


In 2015, when still alive, I plan to connect "something MZ" with the 8MB ramdisk. As the MZ still does not provide an SDIO interface (and therefore still running the sdcard at ~20MHz SPI :( :( ), the ramdisk can speed up the system significantly.. (6x with swap on the ramdisk with retrobsd when running several jobs, maybe more with a filesystem on it).

viewtopic.php?f=5&t=35870

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 10: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
I'm working on porting the spi sram driver from retro at the moment to use my 16 chip SPI SRAM board. Not sure how best to specify the 16 CS pins in the configuration yet though.

_________________
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 Dec 11, 2014 1:17 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
There is still the issue with max SPI speed. Simply it is a bottleneck you cannot avoid with serial sram/fram/mram.
What about a 74154 or friends to make your /CS stuff easier.. :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 1:41 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
Possible, but my board is already built and populated. I'd need to make an adapter board for it. I thought about that after I'd designed and sent it off for fabricating.

Maybe I'll just design a new one with the '154 built in and transfer all the SRAM chips over.

Even with the SPI bottleneck it'll still be faster that SD, and as vi is 502399 bytes in size, every keypress causes swapping while it grabs different chunks of the code...

_________________
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 Dec 11, 2014 2:00 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
An sdcard may have up to 250msecs writing latency, usually around 1-50ms anytime, so it could be faster with a serial sram.. :)
PS> see below writing latency measured with NilRtos logging data to an standard microsdhc card, y=latency peaks in usecs and x=time in msecs.
When measured during longer time period I got 130msec peaks.. You cannot predict the wr latencies, as it is related to the internal housekeeping (wear leveling mostly). It is "random"..


Attachments:
wrlatency.jpg
wrlatency.jpg [ 36.67 KiB | Viewed 17996 times ]

_________________
Pukao Hats Cleaning Services Ltd.
Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 4:32 pm 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
Pito wrote:
Quote:
I eagerly await 4.4 being able to recompile itself on the PIC...in a week, with immense swapping. ;)


In 2015, when still alive, I plan to connect "something MZ" with the 8MB ramdisk. As the MZ still does not provide an SDIO interface (and therefore still running the sdcard at ~20MHz SPI :( :( ), the ramdisk can speed up the system significantly.. (6x with swap on the ramdisk with retrobsd when running several jobs, maybe more with a filesystem on it).

viewtopic.php?f=5&t=35870


I'd love to get one of those RAMdisks...but it seems they are no longer for sale? *sigh* SMT work is a pain with bad eyesight. :(


Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 4:34 pm 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
majenko wrote:
Possible, but my board is already built and populated. I'd need to make an adapter board for it. I thought about that after I'd designed and sent it off for fabricating.

Maybe I'll just design a new one with the '154 built in and transfer all the SRAM chips over.

Even with the SPI bottleneck it'll still be faster that SD, and as vi is 502399 bytes in size, every keypress causes swapping while it grabs different chunks of the code...


I was rather fond of the swapping on every keystroke due to the blinkenlights. ;)


Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 4:51 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
It is a nice effect, shame it just makes typing so painful. Like a 10 baud modem :)

Also I worry what it's doing to my SD card.

_________________
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 Dec 11, 2014 5:10 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
I'd love to get one of those RAMdisks...but it seems they are no longer for sale? *sigh* SMT work is a pain with bad eyesight. :(

The ramdisk is using 48BGA package, 0.75mm pitch. Not easy to solder even with perfect eyesight :)

@majenko: the another option would be the SQI. May be you may invest a long winter evening with SQI driver for an SQI memory your preferred supplier sends to you as the Xmas gift :).
May be there is somebody producing SQI srams with large capacities, or, you may wipe the dust off your altera dev sys and you may try to connect a ddram via SQI to pic32MZ.
But first I would try to measure the speed with a small SQI sram, not to waste too much time with altera when too slow.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 5:23 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Pito and all,

I wonder if the board could be hooked up somehow to a "big system" that acted like a fast swap memory? Hooking up lots of pins seems like the wrong path?

Pito, you latency plot is VERY informative :).

Happy Holidays to all.

Wiz


Top
 Profile  
 
PostPosted: Thu Dec 11, 2014 5:38 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
I wonder if the board could be hooked up somehow to a "big system" that acted like a fast swap memory? Hooking up lots of pins seems like the wrong path?

fat16lib at arduino has connected 500GB HDD via SPI2USB to UNO. It works, so you can connect a big stuff to the wifire sure.. But again, the pic32MZ is quite limited with its simple and slow SPI, I would say it is a big crap, compared to, for example, an stm32F4 and friends. The SDIO is something which is really missing with this device. Having that w/ pic32MZ your sdcard would do 5MB/sec easily.. :?

Another option is the parallel i/o called PMP with pic32, which I use with ramdisk. I think ~30-40MB/sec could be the max PMP speed with MZ in 8bit mode or 60-80MB/sec in 16bit mode. The 8MB ramdisk can do ~10MB/sec block rd/wr max due to its relatively slow SDRAM inside (75ns). It uses 11 signals only..

PS: before the Xmas I will send an 8MB ramdisk module to majenko (pls send me your mail addr), so he may play and write a perfect MZ driver for it. The PMP retrobsd driver (swap and filesystem) does exist, so he may reuse the code. In February there could be a new batch of 8MB ramdisks available at the store.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Dec 12, 2014 12: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
All the SPI SRAM chips I use are also SQI. Max still seems to be 128KB though, and as the MZ only supports two SQI chips on its bus that's not going to be much of a help. And anyway, that would (ideally, if it works in the A4) create 256KB of extra system RAM rather than swap space.

Besides, I was going to try and bend the SQI interface into a 16-colour VGA interface...

_________________
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: Fri Dec 12, 2014 1:23 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
Heh... I just passed the entire LiteBSD tree's C and H files through Artistic Style with my preferred options. It ended up with a 1.8 million line diff in git !!! :twisted:

_________________
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: Fri Dec 12, 2014 1:43 am 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
majenko wrote:
Heh... I just passed the entire LiteBSD tree's C and H files through Artistic Style with my preferred options. It ended up with a 1.8 million line diff in git !!! :twisted:


Tiny.


Top
 Profile  
 
PostPosted: Fri Dec 12, 2014 9:23 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
And anyway, that would (ideally, if it works in the A4) create 256KB of extra system RAM rather than swap space.

Hmm, the overhead with random access to a word is huge with SPI or SQI srams. Maybe 60%..
4MB/sec max random rd/wr access to a word with SQI, I would guess.. 50x slower than rd/wr into the internal ram.
SQI would be great for swap, when larger capacities will be available (ie 1kB block access)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Dec 27, 2014 11:04 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
I've just ordered a prototype board of my PIC32MZ Fubarino-like board. MCHP also have the chips available for sample, so they're on order too.

There's still no USB bootloader support (we're trying to wangle changing the license of some of the Harmony code to BSD so we can use that), so programming will have to be either through a pickit or a UART bootloader and an external FT232 board.

It's highly experimental at this stage (my first MZ board), so I don't know if it'll even power up or not yet.

_________________
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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 192 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9, 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