RetroBSD
http://retrobsd.org/

4.4bsd boot in multi-user mode on pic32mz
http://retrobsd.org/viewtopic.php?f=14&t=37077
Page 8 of 10

Author:  vak [ Tue Jan 13, 2015 7:41 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi Matt,
majenko wrote:
Code:
panic: setrunqueue
syncing disks... done
Seems like the kernel puts the process (presumably /sbin/init) to the run queue, but the process is already in queue. This can be a result of a stray interrupt or wrong interrupt masking. I can try to reproduce this issue on simulator. Please, send me your vmunix.hex file.

majenko wrote:
Serge & Pito - send me your postal addresses and I'll send you one to play with (I have 2 spare MZ chips at the moment).
It would be great to have SDZL board handy. Combined with ENC424J600 Ethernet controller, it would become a perfect networked LiteBSD platform. Address sent by private message.

Author:  vak [ Tue Jan 13, 2015 7:55 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

rmiddleton wrote:
What's different about the MMU on the MZ series vs the MX series? Also, what do you mean in terms of 'memory' - RAM or flash?

MZ has a standard mips32r2 memory management unit implemented, so called TLB block (translation lookaside buffer). It contains 16 dual-page entries. MMU allows to implement a virtual memory for user processes or for the kernel itself. Pages can be loaded from the external media (SD card) on demand. You can find a good description of MIPS MMU in book "See MIPS Run Linux", Chapter 6.

Author:  majenko [ Tue Jan 13, 2015 10:38 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

vak wrote:
Hi Matt,
majenko wrote:
Code:
panic: setrunqueue
syncing disks... done
Seems like the kernel puts the process (presumably /sbin/init) to the run queue, but the process is already in queue. This can be a result of a stray interrupt or wrong interrupt masking. I can try to reproduce this issue on simulator. Please, send me your vmunix.hex file.

majenko wrote:
Serge & Pito - send me your postal addresses and I'll send you one to play with (I have 2 spare MZ chips at the moment).
It would be great to have SDZL board handy. Combined with ENC424J600 Ethernet controller, it would become a perfect networked LiteBSD platform. Address sent by private message.

The config file for the build is in the git repo (SDZL.pic32). Would you rather the .elf file than the .hex file? Easier for debugging an elf isn't it?

Author:  rmiddleton [ Tue Jan 13, 2015 4:59 pm ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

vak wrote:
rmiddleton wrote:
What's different about the MMU on the MZ series vs the MX series? Also, what do you mean in terms of 'memory' - RAM or flash?

MZ has a standard mips32r2 memory management unit implemented, so called TLB block (translation lookaside buffer). It contains 16 dual-page entries. MMU allows to implement a virtual memory for user processes or for the kernel itself. Pages can be loaded from the external media (SD card) on demand. You can find a good description of MIPS MMU in book "See MIPS Run Linux", Chapter 6.


That makes sense. The PIC32 reference manual (section 2) does indicate that all PIC32s have MMUs, but I'm assuming that the implementation is different.

(It has been a while since I have done any OS-related development)

Author:  gewtnet [ Wed Jan 14, 2015 2:12 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

vak wrote:
Hi Matt,
majenko wrote:
Code:
panic: setrunqueue
syncing disks... done
Seems like the kernel puts the process (presumably /sbin/init) to the run queue, but the process is already in queue. This can be a result of a stray interrupt or wrong interrupt masking. I can try to reproduce this issue on simulator. Please, send me your vmunix.hex file.

majenko wrote:
Serge & Pito - send me your postal addresses and I'll send you one to play with (I have 2 spare MZ chips at the moment).
It would be great to have SDZL board handy. Combined with ENC424J600 Ethernet controller, it would become a perfect networked LiteBSD platform. Address sent by private message.


That is the card I should have bought...it has pins I can actually see. ;)

Author:  DanTheMan [ Fri Jan 30, 2015 1:50 pm ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi Serge and everyone,

Will there be i2c drivers built into the kernel in 4.4 BSD Lite? I've been trying to get something working in 2.11 RetroBSD for the MX795 but it's taking me ages to get to grips with how everything hangs together, that's without looking at the pic32 i2c hardware yet! I'm not sure exactly how I should proceed to write the driver, should it be a bus implementation like the spi bus or just a basic driver like the oc and adc drivers??

Any pointers from anyone on here would be much appreciated. Oh yes, I also know the pic32 microchip libraries have issues so using that as a base point would almost certainly give me grief too :)

Keep up the good work :)

Dan

Author:  vak [ Fri Feb 06, 2015 3:52 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

DanTheMan wrote:
Hi Serge and everyone,

Will there be i2c drivers built into the kernel in 4.4 BSD Lite? I've been trying to get something working in 2.11 RetroBSD for the MX795 but it's taking me ages to get to grips with how everything hangs together, that's without looking at the pic32 i2c hardware yet! I'm not sure exactly how I should proceed to write the driver, should it be a bus implementation like the spi bus or just a basic driver like the oc and adc drivers??

Any pointers from anyone on here would be much appreciated. Oh yes, I also know the pic32 microchip libraries have issues so using that as a base point would almost certainly give me grief too :)

Keep up the good work :)

Dan

Thank you, Dan. :)

We have no I2C driver yet. It would be great to have one. I think, a simple implementation like adc would be fine. Current spi driver seems a bit too complicated. It's better to do it without Microchip library, to avoid license issues.

There is an wiki page, a brief tutorial on how to write a driver, created my Matt some time ago: http://retrobsd.org/wiki/doku.php/doc/howto-driver. I've extended it a bit with a generic skeleton for character device, and five easy steps to add it to the kernel. Hope it helps.

Best wishes,
--Serge

Author:  DanTheMan [ Fri Feb 06, 2015 1:52 pm ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Thanks Serge,

I've just completed adding the register definitions to the pic32mx.h header file and now I'm looking at implementing just the master mode for the moment. I can always add the slave mode later in case anyone wants to connect two Retro boards together. Documenting it as I go will help me write one for the MZ when I've done the MX version and once I have MZ hardware to play with.

It'll probably take a few weeks with my busy schedule but once done I'll start a new thread and post the details there.

Many Thanks and have fun, as wiz always says :)

Dan

Author:  RolexTM [ Mon Feb 09, 2015 10:10 pm ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi all,

first of all, this is a brilliant project and it reaaaaalllly deserves more attention. Like how much the 8 Bit Atmel
got that took hours to boot linux, this thing is 1000x cooler!!

Second i got a question that does not seem good enough to open a new thread, could anybody
please tell me where to find the config bits in the LiteBSD source? I managed to config RetroBSD
to my needs (oscillator, pic type, uart config), but i can not find the config in the LiteBSD source.
I may be a bit blind. What i am trying to config is just a plain 32mz2048ecg064 without any external
hardware but the SD card. I spent hours trying to figure it out. :oops:

And third - please keep up your good work guys! I would be willing to help testing if theres
anything i can do.

Alex

Author:  Mikeloto [ Sun Mar 15, 2015 8:59 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Quote:
Second i got a question that does not seem good enough to open a new thread, could anybody
please tell me where to find the config bits in the LiteBSD source? I managed to config RetroBSD
to my needs (oscillator, pic type, uart config), but i can not find the config in the LiteBSD source.
I may be a bit blind. What i am trying to config is just a plain 32mz2048ecg064 without any external
hardware but the SD card. I spent hours trying to figure it out. :oops:


it's inside sys/mips/pic32/machdep.c and then can see the fuses from sys/mips/include/pic32mz.h are not included all options.

Also if you use pickit3, good choice is to use advanced mode and show memory with loaded vmunix.hex and then show configuration memory and then can change anything and try.

I use that to debug the silicon erratas about use of crystal (ON MZ is not good choice to use Crystal, instead use MEMS OSC type on OSC1) 24MHZ and everything works well....

Cheers....

Author:  gewtnet [ Fri Sep 04, 2015 1:40 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

What's the current cheapest and easiest board + NIC that'll do networking? I am very without supplies here at the moment.

(I need something to entertain me until I get my dev boards shipped to my new place here in northern california!)

Author:  vak [ Fri Sep 04, 2015 2:42 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

gewtnet wrote:
What's the current cheapest and easiest board + NIC that'll do networking? I am very without supplies here at the moment.

I would propose Olimex HMZ144 board with Waveshare LAN8720 module ($11 on Ebay).

A connection table is available at page: https://github.com/sergev/LiteBSD/wiki/ ... 44%20board

Author:  DanTheMan [ Tue Sep 15, 2015 7:48 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi All,

I've managed to buy an Olimex HMZ144 and I'm trying to get the firmware loaded onto it using a pickit 3 and V2.20 of the mplab ipe. So far it seems to write to the flash but I get no device connected on the computers usb bus when I power up the HMZ144. Does anyone have a really short step by step on getting the board programmed and booting?

BTW: I've so far only tried the latest autobuild, if that makes a difference!?!

Much appreciated,

Dan

Author:  vak [ Tue Sep 15, 2015 8:11 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Please make sure you have devcfg bits properly configured in MPLAB when you program the board. For correct values see lines 136-157 in file machdep.c.

Unfortunately, MPLAB ignores the devcfg values present in the hex file, so it has to be done manually. That's why I prefer pic32prog.

Autobuild image should work just fine. I tested it a few days ago.

Author:  DanTheMan [ Tue Sep 15, 2015 8:15 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi Serge,

So would it be best to reflash the pickit 3 and use it with pic32prog instead? I'm guessing that I connect it and run the old pickit 3 pc software and reflash it on that first, then try with pic32prog. I'll give that a go rather than load on mpide as i've only loaded the ipe.

Thanks,

Dan

Author:  vak [ Tue Sep 15, 2015 8:26 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

In this case you will lose the ability to use PICkit3 as a debugger with MPIDE, in case you need it someday. I would propose just to buy a cheap PICkit2 clone from AliExpress for $9.

Author:  DanTheMan [ Tue Sep 15, 2015 8:39 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi Serge,

I can always reflash the ipe os back again :) I've switched it back a forth a few times already successfully.

I've tried and it just won't program with the pickit 3. I get memory errors such as "failed to program row flash memory at 1d000000, reply = 00-02-05-07-00". I'll wait until i get home and try with one of my pickit 2's I have lying about.

Thanks again,

Dan

Author:  DanTheMan [ Wed Sep 16, 2015 8:04 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi Serge,

I've managed to finally flash my HMZ144 board with my pickit 2 and after having to redownload the latest autobuild it seems to flash both the boot block and main flash and verifies ok. However I don't get a COM port show up in device manager on my Windows 7 box. Is the console over the usb or another uart on the pic32?

Thanks for all your help,

Dan

Author:  vak [ Wed Sep 16, 2015 8:17 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Hi Dan,

The console is on UART port, not USB. You need to use some kind of serial-to-USB adapter or something. See wiki page: https://github.com/sergev/LiteBSD/wiki/Olimex%20HMZ144%20board

According to the HMZ144 kernel configuration file, UART2 is used for console:
Code:
device          uart2   flags 0x5958    # pins rx=RE9, tx=RE8

# Console options
options         "CONS_MAJOR=17"         # UART device
options         "CONS_MINOR=1"          # UART2

--Serge

Author:  DanTheMan [ Wed Sep 16, 2015 8:38 am ]
Post subject:  Re: 4.4bsd booted in multi-user mode on pic32mz

Thanks Serge!! I thought of checking that just as I pressed the submit button. Sorry for being a pain in that regards. I've got it all working now, just need to sort out my sd card image and I'm running.

Many thanks again!

Dan

Page 8 of 10 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/