Development docs

From SpareMiNT Wiki
Jump to: navigation, search

Contents

Compiling the kernel

To compile the kernel and XaAES you must use gcc. No other compilers are supported. See here for details.

Compiling a kernel for a specific machine is actually pretty easy!

  1. Get the kernel sources ( via CVS access or from nightly builds).
  2. Unpack the sources and change into directory "sys".
  3. If you want to compile a kernel for Milan, type: "make mil".
  4. The compilation should start right now.
  5. When the compilation finishes, you should find a new kernel within the folder ".compile_[architecture]" where architecture must be replaced with the target that you passed to make. For the Milan, that would be ".compile_mil". See below for a list of architectures.


List of make targets

  • all - compile all kernels, all drivers, (TODO: all tools?).
  • sockets - the socket interface (TODO: network drivers?).
  • xdd - the device drivers.
  • xfs - the filesystem drivers.
  • 000 - plain 68000 kernel for machines without MMU. (ST, STE, MSTE).
  • 020 - for machines with 68020 CPUs. (ST and STE with PAK or Veloce).
  • 030 - TT and plain Falcon.
  • 040 - Hades040 and Falcon with Afterburner.
  • 060 - Hades060 and Falcon with CT60.
  • mil - Milan.
  • ara - ARAnyM.
  • col - ColdFire CPUs. As of May 2011 this is still not finished, but As of October 2012 is running well on the FireBee under FireTOS and CF native under EmuTOS.
  • deb - this creates the same kernel as the 000 kernel, but it includes verbose debug information.
  • all-kernels - compile all the kernels.


CrossCompiling the kernel

To compile the kernel and XaAES using the CrossCompiler do the following steps

  1. Get the kernel sources ( via CVS access or from nightly builds).
  2. Unpack the sources and change into directory "sys".
  3. type make CROSS=yes
  4. The compilation should start right now.
  5. When the compilation finishes, you should find a new kernel within the folder ".compile_[architecture]" where architecture must be replaced with the targets above.


Compiling a debug kernel

If you want to enable debug messages within an specific kernel, you must define the symbol DEBUG_INFO. There are 2 methods for doing that:

  • Editing the KERNELDEFS file within sys folder.
    • Look for the target you want to build within the file sys/KERNELDEFS.
    • within the target specific block, add this line: KERNELDEFS += -DDEBUG_INFO.
    • If you want debug info for all targets, just place the line "-DDEBUG_INFO" on top of the KERNELDEFS file.
  • Passing the Symbol via command line to make.
    • TODO: how to do it?

Coding style

The coding style ...


Kernel

(posix compliant, pre-emptive, and no vitual memory management) ...


Kernel structure

The structure of the MiNT Kernel ... (TODO: find and read docs)


Kernel sourcetree

FreeMiNT kernel sources are stored in a CVS database.

Kernel modules

As of the 30th March, 2011, only the kernel itself and the XaAES kernel module is compiled for the CPU specific for the target architecture. All other modules (device drivers, filesystem drivers etc) and tools are compiled for the 68000.


Device drivers

  • *.xdd

Devices that are not Filesystems or Network Interfaces, are compiled with the XDD extension and can be found in the following directories:

  • CVS/freemint/sys/xdd/
    • audio/ - (standard ST/E/Mega/TT/Falcon/FireBee/Hades) Yamaha YM2149 Sound Chip and (STE/MegaSTE/Falcon) DMA sound driver.
    • dsp56k/ - Motorola DSP5600x based Digital Signal Processor (dsp56k-gcc).
    • flop-raw/ - floppy device access.
    • lp/ - line printing device.
    • mfp/ - (not ARAnyM) multi-function port serial driver.
    • nfstderr/ - (ARAnyM/emulator) Native Features Standard Error redirect (to host console).
    • scc/ - (MegaSTE/TT/Falcon) SCC serial port controller.
    • skeleton/ - base, bare bones, for building a new device driver.
    • uart/ - (Milan) UART serial port controller.
    • whlmoose/ - mouse wheel driver (obsolete).
    • xconout2/ - console output, version 2.


Filesystem drivers

  • *.xfs

Filesystem drivers are compiled per CPU type with the XFS extension. Any new filesystem drivers should be added into ther own directory, using skeleton as a base starting point. The following filesystem drivers are available:


Network drivers

  • *.xif

Network Interface drivers are compiled per CPU type with the XIF extension. Various network interface drivers can be found in CVS/freemint/sys/sockets/xif/.


MiNT KM

The MiNT Kernel provides a kernel module interface, for devices and drivers that require kernel access. Currently there are two modules using this interface, XaAES and - from FreeMiNT 1.18 - the USB stack.

At the moment this interface is not fully defined or documented, except for those requirements for the above driver types, and those enabling XaAES to successfully interface between the kernel and user space. Because of the nature of XaAES, those requirements should provide enough functionality for most uses. Another example would be a VDI as a kernel module. Some threads on the MiNT Mailing List discuss making fVDI into a kernel module.

  • [MiNT] fVDI TTF issues (2004).
  • [MiNT] fVDI issues (2004).
  • [MiNT] XaAES sources for FreeMiNT 1.16.3 (2009) (about post 50+ when Johan Klockers starts posting).

Some discussions where taken up in 2009 with regard to inter-module communications, which may be done much more efficiently in other ways, specifically if XaAES AND fVDI are both kernel modules.

Some information and documentation written by Frank Naumann, detailing kernel module specifics, can be found in various text files in the CVS. (TODO: which ones?)


Note: some information within text files in the CVS source tree may be out of date. Please use the MiNT Mailing List if you have questions or want clarification. This will also help is updating the documentation and specifications.


Debugging

Personal tools
Resources