AROS on Efika status update

I haven’t been posting here for a very long time – sorry about that. I hope you still remember me 🙂 The AROS port to Efika progresses nicely. There were some issues with handling of the MMU unit but now they are luckily ironed out.

The kernel.resource which happens to be the core of AROS, has been extended compared to the version which sam440 port uses, and even more extended compared to the x86_64 version. It uses MMU a bit more – protect all regions of memory which shouldn’t be accessed, provides supervisor address space starting at 0xff000000 and provides access to a “virtual” SysBase, i.e. reading a 32-bit value (and only 32-bit one!) from address 0x00000004 will give you the pointer to the ExecBase structure.

Kernel resource exposes four new functions to the user space. KrnMapGlobal maps the physical address range of specified size into virtual one, using desired protection and caching settings. KrnUnmapGlobal removes the mapping created above. KrnCreateContext creates a cpu context stored in the area accessible by supervisor only. KrnDeleteContext removes the cpu context and eventually unbinds it from the FPU (kernel.resource in efika will use lazy FPU context switching).

There is also a new system call – SC_REBOOT. It performs a soft reboot of AROS on efika. Don’t be afraid about non-intentional syscall which could reboot your efika, it may be done only in kernel.resource and exec.library. A system call which would occur from any other address range would cause no action.

Apart from the low-level stuff I tried to boot AROS with a bit more modules. The result looks like this:

Welcome to SmartFirmware(tm) for bplan EFIKA5K2
Version 1.3 (20070122084838)
SmartFirmware(tm) Copyright 1996-2001 by CodeGen, Inc.
All Rights Reserved.
Pegasos BIOS Extensions Copyright 2001-2007 by bplan GmbH.
All Rights Reserved.
ok boot

Second Level Bootloader for OpenFirmware
Build 242 from Sep 13 2008
Available memory 128MB

Available boot configurations:
1. AROS for Efika 5200
2. AROS for Efika Test 2
Boot? (4.8)>

Loading “AROS for Efika 5200”

[KRN] EFika5200B Kernel build on Oct 1 2008
[KRN] BootMsg @ 0x19111e4
[KRN] Copying TagList and data
[KRN] CmdLine: ‘command_line_option_1 command line “line option”‘
[KRN] Initializing exception handlers
[KRN] Initializing MMU
[KRN] Location of MMU tables: 07000000-070fffff
[KRN] SDR1 = 0700000f
[KRN] Flushing TLB
[KRN] MBAR at f0000000
[KRN] HID0=0000c000 HID1=40000000
[KRN] Entering ictl_init.
[KRN] Stopping all interrupt activities
[KRN] Mapping 00003000-06ffffff range for public use
[KRN] Mapping f0000000-f002fffc range for MBAR
[KRN] Mapping ff100000-ff123fff range for public read-only access
[KRN] Mapping ff124000-ff7f4fff range for supervisor
[KRN] Mapping ff7f5000-ff7fffff range for read-write
[KRN] Mapping ff800000-ff8b6fff range for read-only
[KRN] Mapping ff8b7000-ffffffff range for supervisor
[KRN] Supervisor mem: 6979KB free
[exec] AROS for Efika5200B – The AROS Research OS
[exec] Preparing the ExecBase…
[exec] ExecBase at 00003280
[exec] Clearing ExecBase
[exec] Initializing library…
[exec] Adding memory
[exec] Done. SysBase->ThisTask = 0x004180
[exec] Resident modules (addr: pri version name):
[exec] + 0xff80fd50: 127 2 “kernel.resource”
[exec] + 0xff811070: 126 41 “exec.library”
[exec] + 0xff8142ec: 110 41 “expansion.library”
[exec] + 0xff81b658: 104 1 “partition.library”
[exec] + 0xff816828: 103 41 “utility.library”
[exec] + 0xff81c92c: 102 41 “aros.library”
[exec] + 0xff81f9c0: 101 40 “mathieeesingbas.library”
[exec] + 0xff81d820: 100 41 “bootloader.resource”
[exec] + 0xff823d5c: 94 41 “oop.library”
[exec] + 0xff824fe4: 92 1 “hiddclass.hidd”
[exec] + 0xff8b56a4: 90 1 “pci.hidd”
[exec] + 0xff866a60: 65 41 “graphics.library”
[exec] + 0xff8aaa38: 60 41 “layers.library”
[exec] + 0xff8aded0: 50 41 “timer.device”
[exec] + 0xff81bdf0: 45 41 “battclock.resource”
[exec] + 0xff82582c: 45 41 “misc.resource”
[exec] + 0xff8af5b0: 44 41 “gameport.device”
[exec] + 0xff8b0d2c: 44 41 “keyboard.device”
[exec] + 0xff86b158: 40 41 “keymap.library”
[exec] + 0xff8acc8c: 30 41 “input.device”
[exec] + 0xff8a0afc: 10 50 “intuition.library”
[exec] + 0xff869d30: 8 41 “cybergraphics.library”
[exec] + 0xff83c4d8: 0 1 “graphics.hidd”
[exec] InitCode(RTF_SINGLETASK)
enter InitCode(0x2, 0)
calling InitResident(“kernel.resource”, NULL)
[KRN] Kernel resource post-exec init.
[KRN] Interrupts enabled
[KRN] Entered user mode
calling InitResident(“expansion.library”, NULL)
leave InitCode(0x2, 0)
[exec] InitCode(RTF_COLDSTART)
enter InitCode(0x1, 0)
calling InitResident(“partition.library”, NULL)
calling InitResident(“utility.library”, NULL)
calling InitResident(“aros.library”, NULL)
calling InitResident(“mathieeesingbas.library”, NULL)
calling InitResident(“bootloader.resource”, NULL)
[BootLdr] Init. msg=0xff7ffc30
[BootLdr] KRN_CmdLine=0xff123ad0
[BootLdr] CmdLine=”command_line_option_1 command line “line option””
[BootLdr] Init: Argument command_line_option_1
[BootLdr] Init: Argument command
[BootLdr] Init: Argument line
[BootLdr] Init: Argument “line
[BootLdr] Init: Argument option”
calling InitResident(“oop.library”, NULL)
calling InitResident(“hiddclass.hidd”, NULL)
calling InitResident(“pci.hidd”, NULL)
[PCI] Initializing PCI system
[PCIDriver] Dummy Driver initialization
[PCI] base class initialization
[PCI] Everything OK
calling InitResident(“graphics.library”, NULL)
calling InitResident(“layers.library”, NULL)
calling InitResident(“timer.device”, NULL)
calling InitResident(“battclock.resource”, NULL)
calling InitResident(“misc.resource”, NULL)
calling InitResident(“gameport.device”, NULL)
calling InitResident(“keyboard.device”, NULL)
calling InitResident(“keymap.library”, NULL)
calling InitResident(“input.device”, NULL)
calling InitResident(“intuition.library”, NULL)
calling InitResident(“cybergraphics.library”, NULL)
calling InitResident(“graphics.hidd”, NULL)
leave InitCode(0x1, 0)
[exec] I should never get here…
[KRN] Uhm? Nothing to do?

Next module beeing working on is timer.device. Unfortunately, it will have worse resolution than the timer in sam440 – circa 7µs.

Ten years ago…

… I was preparing my very first commit for AROS. It wasn’t much. A tiny bootsector loading few sectors from floppy. These sectors contained some startup code followed by empty function written in C. Everything else was written in assembler.

No, it wasn’t working yet. It was just proof of concept. A small check whether I will be able to perform this task. I was ten years younger and much more stupid of course. It was beginning of a great adventure.

And then, three days later, the cvs mailer generated an email containing these few lines:

* schulz 15.09.1998 22:31:13

  AROS/config/ibmpc/boot/: Makefile(A), README(A), bootsect.S(A), 
  head.S(A), init.c(A), setup.S(A), video.S(A):
  At least. The first pre-alpha version. Not to much for now, but it 

The mysterious story of native x86 AROS begun. It’s time to open some wine 🙂