Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
User Journal

Journal Alioth's Journal: [Z80] Software time 2

It's now coming to that time where I need to think a bit about software. With the success of getting the z88dk retargeted to run on my board, I'm thinking what needs to go into the ROM. The system portion of ROM will live in the lower 16K.

The Unix approach is very attractive - make it so all the devices can just be accessed using stdio. This will make the subsequent C programs easy to write, with a standard interface known by any C programmer. So basically, this will require:

- a way of managing file descriptors
- low level open(), read(), write(), close() and ioctl() in ROM, which knows how to then pass on the request to the actual code that works the device. Probably in the form of a jump table - so the file descriptor will be associated with a pointer into ROM, which contains a jump table to the applicable calls for the device.
- a very simple file system so that data can be organized in the rest of the flash chip.

The vast majority of devices I intend to use are highly amenable to this treatment. It'll take a little careful planning, but it should make the programs I intend to run on the beast easier to write (and also insulate them somewhat from any future hardware changes I might make). The devices where it doesn't make sense (such as programming a complete flash chip, which is after all, a device which you can randomly access) will just have to have their own system calls but these will be the exception.

This discussion has been archived. No new comments can be posted.

[Z80] Software time

Comments Filter:

Q: How many IBM CPU's does it take to execute a job? A: Four; three to hold it down, and one to rip its head off.

Working...