Quark (kernel)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In computing, Quark is an operating system kernel used in MorphOS. It is a microkernel designed to run totally virtualized computers, called "boxes" (see sandbox). Currently only one "Box" is available, the ABox, that lets users run existing AmigaOS software compiled for MC680x0 and PowerPC processors.

Design goals[edit]

Quark microkernel borrows concepts from L4 microkernel family but is not an L4 implementation itself. For example the clan, id concept and recursive address mapping comes from L4. Quark also has an asynchronous/synchronous message interface similar to Amiga's Exec kernel but adapted to the memory protected environment.

Other Quark features include:

For this new kernel a hardware abstraction layer is used which provides the necessary hardware resource information like scanning all zorro boards, PCI boards and local hardware resources.[1][2]

Functions[edit]

  • SYS_AddLinkMessage
  • SYS_AttemptSemaphore
  • SYS_AttemptSemaphoreShared
  • SYS_CopyCPUHalConfig
  • SYS_CreateMemList
  • SYS_CreateTask
  • SYS_DeletePort
  • SYS_DeleteSemaphore
  • SYS_DumpMemHeader
  • SYS_FindFreeMemArea
  • SYS_FindSkipSize
  • SYS_GetLinkMessage
  • SYS_GetMessageAttr
  • SYS_GetNextCPU
  • SYS_Init
  • SYS_InsideClan
  • SYS_IsClanMember
  • SYS_MMUAddPage
  • SYS_MMUGetEntry
  • SYS_MoveRomModuleToMemoryEnd
  • SYS_ObtainPort
  • SYS_ObtainSemaphore
  • SYS_ObtainSemaphoreShared
  • SYS_ReleaseSemaphore
  • SYS_ReplyMessage
  • SYS_SendMessage
  • SYS_SetMessageAttr
  • SYS_SetupPageTable
  • SYS_ShowExceptionThreads
  • SYS_ShowForbidThreads
  • SYS_ShowIntThreads
  • SYS_ShowQuarkState
  • SYS_ShowReadyThreads
  • SYS_ShowRunThreads
  • SYS_ShowThreads
  • SYS_ShowWaitIntThreads
  • SYS_ShowWaitThreads
  • SYS_Start
  • SYS_StartNextThread
  • SYS_StartThread
  • SYS_WaitPort

Trance JIT[edit]

Trance JIT is a MorphOS JIT compiler, or code translator, for running 68k applications within the MorphOS environment. It has been part of the MorphOS operating system since MorphOS 1.4.[3]

MorphOS itself has a fully integrated 68k emulator for running many Amiga applications. (Amiga programs were almost exclusively compiled for the 68k processor, while MorphOS itself is PowerPC). Trance supplements this functionality by adding JIT compilation, increasing the speed of the emulation even further. It does not interfere with the full integration of 68k and PowerPC tasks MorphOS provides.[4]

Trance exists in the form of an executable, run during boot, and a shared library. Although it is not technically part of the kernel, and MorphOS can be run without it, Trance is considered a fundamental part of MorphOS and one of its most powerful features.

Compatibility of Trance is considered to be very high and there are few to no 68k instruction sequences or applications which cause it any problems. It is also considered to be very fast, with users noticing few differences between 68k programs and native PowerPC code. [5][6][7]

Trance was developed by Ralph Schmidt and Teemu Suikki, with minor support from other MorphOS team members, Mark Olsen, Sigbjørn Skjæret and Harry Sintonen.


ABox[edit]

Under the Quark kernel a PowerPC native reimplementation of the OS known from the Commodore A1000, A500(+), A600, A2000, A1200, A3000(T) and A4000(T) systems runs as a mixture of a virtual emulation and a driver. This OS driver is called as ABox.

The 68k emulation is written in C and uses gcc assembler macros where necessary to speed up certain complex instructions. Even though the emulation is written in C, its structure is on a level where handcoded assembler isn't significantly faster.

A JIT (Just In Time) engine called Trance for MorphOS to speed up old 68k programs beyond the current state of the traditional emulation is also available.

The PPC native Exec supports the PowerPC register model which means there's no difference for this Exec if it runs 68k or PowerPC code. PowerPC code does not block multitasking inside the OS box like in emulations where the 68k code is just emulated in some host system's task (then every access outside this environment would stop the multitasking in the emulated environment).

For applications running under this new PowerPC A-Box kernel 68k code runs as subroutines inside PowerPC tasks. For 68k or PowerPC applications it's completely transparent if some library, hook, interrupt is still 68k or already using PowerPC code.[8]

Early in its development, there was a relatively common misconception that the Quark Microkernel in MorphOS is related to or borrowed from the QNX operating system. This is entirely false.

References[edit]

  1. ^ "MorphOS? What's that, then?", AmigActive, July 2000: 14–17 
  2. ^ David Gerber (2002). "MorphOS Full Features List". Retrieved 2010-07-28. 
  3. ^ "MorphOS 1.4 available". 9 August 2003. Retrieved 2010-07-28. 
  4. ^ "MorphOS? What's that, then?", AmigActive, July 2000: 14–17 
  5. ^ "How fast is MorphOS?". 8 February 2003. Retrieved 2010-07-28. 
  6. ^ "MorphOS 68k speed". 3 November 2002. Retrieved 2010-07-28. 
  7. ^ "Comparatif : performances entre AmigaOS 4.1 et MorphOS 2.3 sur Pegasos II (French)". September 2009. Retrieved 2010-07-28. 
  8. ^ "MorphOS Full Features List". 11 December 2002. Retrieved 2010-07-28.