Tools that helped to build HelenOS

19
Tools that helped to build Tools that helped to build HelenOS HelenOS Jakub Jermář [email protected] http://www.helenos.org http://www.helenos.org

Transcript of Tools that helped to build HelenOS

Page 1: Tools that helped to build HelenOS

Tools that helped to build Tools that helped to build HelenOSHelenOS

Jakub Jermář[email protected]

http://www.helenos.orghttp://www.helenos.org

Page 2: Tools that helped to build HelenOS

CompilersCompilers

Page 3: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 3

Compilers vs. supported targetsCompilers vs. supported targets

GNU Compiler Collection

LLVM/Clang Intel C++ Compiler

Sun Studio Portable C Compiler

amd64 yes yes yes yes yes

arm32 yes yes no no no

ia32 yes yes yes yes yes

ia64 yes no yes no no

mips32 yes no no no no

ppc32 yes no no no no

sparc32 yes no no yes no

sparc64 yes no no yes no

Page 4: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 4

CompilersCompilers

All aim for GCC compatibility

Most assume/require binutils

None but GCC supports all architectures

binutils + GCC = natural choice

Clang doesn't do the whole trick yet

Page 5: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 5

GCCGCC

Interesting bugs and limitations

ia64: wrong scheduling of chk.s (bugs 53975, 66660)

mips32: incorrect unaligned accesses (bug 23824)

mips32: problems parsing TLS accesses prior to 4.1.0

mips32: scheduling RDHWR in a branch delay slot

sparc64: limitations of inline assembly constrains

Use of ­Werror ­Wall ­Wextra with ­O3

Lack of returns_twice attribute

Page 6: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 6

Toolchain scriptToolchain script

Different versions of GCC support different features

Different versions of GCC produce different warnings

­Werror + ­Wall ­Wextra + ­O3

tools/toolchain.sh installs the supported toolchain (binutils, GCC and GDB)

Page 7: Tools that helped to build HelenOS

SimulatorsSimulators

Page 8: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 8

Who needs simulators, anyway?Who needs simulators, anyway?

sparc64/sun4u

sparc64/sun4v

arm32/ARMv4

arm32/ARMv6

arm32/ARMv7

ia64

ppc32/G4

sparc64/sun4u

arm32/ARMv7

HW as a simulator of itself

eBay comes to rescue

BUT

Not very practical

SW is eternal, HW not so much

Page 9: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 9

Simulators vs. architectureSimulators vs. architecture

Bochs VMware msim Ski Simics QEMU PearPC GXemul VirtualBox gem5

amd64 yes yes no no yes yes no no yes yes

arm32 no no no no yes yes no yes no yes

ia32 yes yes no no yes yes no no yes yes

ia64 no no no yes yes no no no no no

mips32 no no yes no yes yes no yes no no

ppc32 no no no no yes yes yes yes no no

sparc32 no no no no yes no no no no no

sparc64 no no no no yes yes no no no yes

Page 10: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 10

SimicsSimics

Swiss Army knife of simulators v1

Introspection & tracing

Reverse engineering FHC

Checkpoints & reverse emulation

Closed source

Virtutech → Intel

Unpenetrable licensing procedure

Page 11: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 11

QEMUQEMU

Swiss Army knife of simulators v2

OpenBIOS for ppc32 and sparc64

Helped to bring sparc64 to QEMU

Good indication of QEMU regressions

Linuxisms: failing TLBP (mips32)

https://bugs.launchpad.net/qemu/+bug/1128935

GDB can be used to debug guest

Page 12: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 12

SkiSki

HP → open source → aging on SF

Nuisance to build on modern desktop

Some functionality broken

No active maintanance

Crossbreed with QEMU?

Alternative to reviving KVM on Itanium

Page 13: Tools that helped to build HelenOS

BootloadersBootloaders

Page 14: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 14

Bootloaders vs. architectureBootloaders vs. architecture

GRUB GRUB 2 SILO ELILO OBP Das U-Boot Yaboot

amd64 yes yes no no no yes no

arm32 no no no no no yes no

ia32 yes yes no yes no yes no

ia64 no no no yes no no no

mips32 no no no no no yes no

ppc32 no yes no no no yes yes

sparc32 no no no no no yes no

sparc64 no Linux yes no yes no no

Page 15: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 15

BootloadersBootloaders

Microkernel boot issue: large initrd & init tasks

Multiboot specificaiton

image.boot

ELILO

hello EFI application (GNU EFI + efilib)

image.boot directly

OBP

Serengeti (Simics) 544.3 kg

Page 16: Tools that helped to build HelenOS

Build systemBuild system

Page 17: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 17

Build systemBuild system

make

Python

Configuration

Autotooling

Autogenerated structures and offsets

JSON (no comments)

YAML (no tabs)

YAML → .h

Root file system creation

Page 18: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 18

ConclusionConclusion

Non-portable/non-crosscompilable tools

Multitude of tools ↔ HelenOS portability

Linuxisms → latent bugs in tools

Vintage platforms → vintage tools

Vintage platforms ↔ computer architecture

“Perhaps addressing this problem fully isn't on anyone's TODO list for the moment (ia64...) but if speculation becomes more important in future target then...”

–from GCC Bugzilla

Page 19: Tools that helped to build HelenOS

Jakub Jermář, FOSDEM 2016, January 30th Tools that helped to build HelenOS 19

Q&AQ&A

http://www.helenos.org

@HelenOSOrg

@jjermar

Thank you!