MICONOX is an abbreviation for "Microcomputer Native Operating Extensions"
At the moment Miconox is an interface for serial peripheral devices. It is oriented at the UNIX (R) interface. It is designed to be enhanced for block devices. More functionality like threading, memory management and others may be added in the near future.
MICONOX is develloped by me for my own use only. I provide it as Freeware without any support or warranty. It may be used freely inside any product but you may not charge anybody for MICONOX itself.
MICONOX should provide a standardized interface for access of peripheral devices. Functions may be written that use the serial interface, keyboards, LCD-displays, printers, I2C and others without the need for special interfaces. You may change the output from LCD to printer or serial interface without changing your program.
High level functions like the formatting program printf may be written to work with every kind of peripheral device without change.
MICONOX is designed to work on Microcontrollers with limited memory. All the overhead defined for UNIX/LINUX to serve in complex multiuser networked environments are stripped away.
MICONOX is develloped using the GNU C compiler for AVR. It may be simple to port MICONOX to other Microcontrollers than Atmel AVR, but no attempts have been made by me so far.
The main program is part of MICONOX and is located the file "miconox.c".
After initialization of the devices the application main appl_main()
is called, that is written by you. See the file "test.c" for an example application.
Core of the system is the file control as declared in fcntl.h and implemented in "fcntl.c".
The files "config.c" and "config.h" are the only files of MICONOX
that should be changed by you to match your needs. In the table dir
you define a list of textual names for your devices and a major and minor device
number. The major device number is used as an index into the character device
table cdevsw
. The minor device number is transferred on calls to read and write
to identify one of several devices that are handled by the device driver.
A file is first opened, then it may be read and/or written and controlled. When ready then the device will be closed.
A file is opened by using a device name. The device name is looked up in the directory structure dir
. The found major and minor device numbers are written into the filetable
. The open function of the device is called. The index in the
filetable is returned as the filedescriptor.
When read, write or ioctl is called, then the filedescriptor
is used
to get the major device number from the filetable
. The function
stored in table cdevsw
for the device is called and the minor device number
from the file table and the other call parameters are provided.
The function ioctl
is device dependent. it accepts two parameters
of type uint8_t. The first parameter is a command id and the second is a parameter
for this command. It may be used to configure the device i.e. define the baud rate.
The close function will do any clean ups. The file is removed from the filetable.
If you have problems with the overhead that fcntl needs, you may also call the character device drivers directly. Just call first the open function of the device driver, then any read/write/ioctl and call close at the end. All you have to do is to provide a valid minor device number at each call.
Have a lot of fun and success with MICONOX!
© Mario Boller-Olfert 2002 - E-Mail: Kontaktformular - 123-Byte