16-bit code and L4
voelp at os.inf.tu-dresden.de
Wed Jun 20 13:42:57 CEST 2007
Valery V. Sedletski wrote:
> So, the questions are:
> 1) There is L4Linux. It is mostly 32-bit. But as I know, the Linux kernel also contains some 16-bit parts, such as setup code (it
> works with BIOS routines and probes hardware), and also (as I heard) acpi suspend/wakeup code. So, it contains 16-bit
> segments. But doesn't it interfere with L4? How did the people porting Linux to the L4 microkernel solve the problem of 16-bit
> code? And doesn't it interfere with ELF format capabilities (it is pure 32/64-bit, as I understand)?
The parts of 16-bit code in the Linux kernel are primarily to bootstrap
the system and to bring it up again from deep sleep modes. In L4Linux,
the microkernel does most of this job. So there is no need to run these
parts in L4Linux anymore and they have thus been removed during the porting.
> 2) Must all the segment registers be CS == DS == ES == FS == GS == SS == FLAT in L4 usermode programs (in Intel
> architecture implementation)? Or, there exist a possibility to use segments other than FLAT?
Fiasco preserves some of these segments (e.g., GS to support thread
local storage). However, unless OS/2 makes use of these segments in
32-bit mode there is no need to change these from a flat setting.
> 3) Is it possible to cause the L4 kernel to create 16-bit segment descriptor on Intel architecture?
What you are looking for is microkernel support for the virtual x86
mode. Unfortunately, only the old L4 assembler kernels supported this
processor mode and these are no longer supported. If you really want to
run the 16-bit code on bare metal (and not in something like qemu) you
probably need to add support for VM86 into the kernel (e.g., by adding
an architecture specific systemcall which executes some code in VM86
mode and which returns with any abnormalities to a 32-bit exception
Technische Universität Dresden
Department of Computer Science
Institute for System Architecture
Tel: +49 (351) 463 38350
Fax: +49 (351) 463 38284
Email: voelp at os.inf.tu-dresden.de
More information about the l4-hackers