RetroBSD

2.11BSD operating system for microcontrollers
It is currently Wed Feb 19, 2020 11:57 pm

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Wed Feb 18, 2015 2:07 pm 
Contributor

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

I found my original patch set. wiz.zip. Serge may have it stored somewhere?

It would probably be better given all the hacking out there if I sent it to you as an e-mail rather than post it and draw attention to myself :).

It is a 57k .zip file.

So, please post whatever e-mail you wish and I'll send it along.

It will be nice when we have real networking working. Right now I use sz/rz to send files from the 'big box' to and from my retrobsd systems. Works great but real networking would be nicer.

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Thu Feb 19, 2015 12:56 pm 

Joined: Mon Nov 24, 2014 1:07 pm
Posts: 58
Thanks Wiz, much appreciated.

I'm still learning as I go with the occassional help from the embedded c guys at work that sit behind me. So far so good and I'm really starting to enjoy it, a bit like the good old days of writing in pure 68000 assembly for the Atari ST and 68030 for the Atari Falcon 030. They were fun days, lots of crashes with cherry bombs being displayed on the screen and funny noises coming out the TV :)

I'd love to have a serial terminal to vga adapter hooked up to this fubarino plus ethernet and keyboard so I could use it like a real old school unix system. That'd be fantastic! Maybe one of these days I'll dig out my xilinix fpga dev kit and redo the vhdl and create a module for this to do precisely that. If I ever get enough time :)

Have fun everyone and thanks again,

Dan


Top
 Profile  
 
PostPosted: Thu Feb 19, 2015 1:28 pm 
Contributor

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

RetroBSD really is a LOT of fun :) :).

There is/was a VGA driver for PIC32 as a part of geoffg.net, Micromite version of basic.

Originally there was source code :). Eventually you had to ask for it. And now the VGA stuff seems to have disappeared. I and I assume Serge still have the old code around 'somewhere'.

One of my PIC32 breadboards supports both VGA and ps-2 keyboard. Works great. But uses quite a bit of RAM for the video buffer. A user land program could probably be written to drive the VGA display whenever it is in memory which would probably be quite useful.

One of Geogg G's example programs plots ADC data in real time on the VGA screen. Pretty neat.

IMHO a much neater solution would be to figure out how to map the screen into html5 and use a connected web browser as the 'terminal'. I haven't figured out enough html5 to make this happen yet, but it 'should' be possible :). ( The proof is left to the serious student as an excersize. :) :) )

All that said, RetroBSD is a LOT of fun. Brings back old memories for me also. I did a PCB with the first Intel 4004 and actually wrote a driver for a version of the IBM selectric.

Somewhere I have an early 6502 without the ROR instruction. Then after a panic, ROR was added to the chip.

Happy Hacking !!

Lots of fun.

Wiz


Top
 Profile  
 
PostPosted: Thu Feb 19, 2015 1:35 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 have VGA code for the PIC32. I am going to be building it into my DisplayCore library for chipKIT. I want to see about enhancing it for the PIC32MZ to use the SQI interface to give 4-bit colour depth.

_________________
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 Feb 19, 2015 2:54 pm 

Joined: Mon Nov 24, 2014 1:07 pm
Posts: 58
Ooh, a PIC32MZ with a 4 color VGA output, I like the idea of that!!

Back on the subject of I2C, I've been thinking about the generic read / write functions. How about using the ioctl calls as usual for configuration and setting a device up, say an adc at x address and adc register y. Then the read function will just return a new read from that device just like issuing a "cat /dev/adc0" but on an iicx device. Internals of the driver would keep the address x of the device and register y of the device if you see what I mean. The reverse would also work but with say a dac and a write call.

i.e. Device on the i2c bus at address 48 and each read of register at devices internal address 90 would return the adc's value.

Does that sound about right to everyone?

I'm slowly getting there, learning c and writing the driver at the same time whilst I should be working which is really cheeky! Can't wait to get this finished and have at least made a contribution to the project, even if it is a small one.

Have fun everyone,

Dan


Top
 Profile  
 
PostPosted: Thu Feb 19, 2015 3:08 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Imagine I have got six different i2c devices on the single i2c bus, and, there will be six various jobs running in background, each job accesses its own device. Will that work?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Feb 19, 2015 3:23 pm 

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

I don't think that'll work, at least not in the first iteration of the driver. The reason is that the iic module itself is seen as a file device just as all *nix devices are. Once that file is opened, unless in shared mode, then the process that reads or writes could interfere with another process. Great care would need to be taken to prevent that happening with the use of semaphores (locks) and processing a request in full and blocking the next read or write until that transaction is complete.

I'm not very good at explaining things so please bear with me. Matt might be able to explain it better than me. It can be done I believe but don't expect the first version of the driver to be able to do that, it'll be very basic to start with and hopefully improved upon as time progresses and permits. I'll keep it in mind though and add it to the list of requested features.

You raise a good point though and maybe further abstraction could be done so that bus devices also appear in the dev node tree, such as iicd48 which would be a pcf8591 (4 channel adc and 1 channel dac) device sitting at address 0x48. Then each read and write to that device would call the underlying driver say iic1 (I2C bus 1) and issue the reads and writes. I haven't got that far along yet so anything is possible.

Feel free to comment or make suggestions though everyone, that's how good things are made great in my opinion....

Have fun,

Dan


Top
 Profile  
 
PostPosted: Thu Feb 19, 2015 3:56 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
That is the issue with drivers, not only i2c but all - they must support that kind of operation when using in multitasking environments. It will not be easy with i2c, I would say..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Feb 24, 2015 1:37 pm 

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

Teasing out the devices into the device tree would not be the way to go, no version of l*nix does this with i2c anyway. Therefore different apps would use different busses ie App a would use i2c bus 0 and App b would use i2c bus 1. Another method would be to use the bus sequentially, ie App a opens bus 0, reads / writes to device 0x20 and closes the bus. Then App b opens the bus and reads / writes to device 0x48.

I suppose you could check for file locks to determine if the bus is idle or ready to take control of to accomplish using two applications with different or even the same device on the same bus.

Anyway, time to crack on with the little time I'm able to throw at this driver. I wish I had more time, perhaps a 28 hour day would help :)

Have fun everyone,

Dan


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

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