File:  [NetBSD Developer Wiki] / wikisrc / projects / project / verify_netbsd32.mdwn
Revision 1.4: download - view: text, annotated - select for diffs
Fri Feb 20 19:48:08 2015 UTC (6 years, 11 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by mspo

[[!template id=project

title="Verification tool for NetBSD32"


[Jörg Sonnenberger](

duration="3 months"

NetBSD supports a number of platforms where both 32bit and 64bit execution is possible.
The more well known example is the i386/AMD64 pair and the other important one is SPARC/SPARC64.
On this platforms it is highly desirable to allow running all 32bit applications with a 64bit kernel.
This is the purpose of the netbsd32 compatibility layer.

At the moment, the netbsd32 layer consists of a number of system call stubs and structure definitions written and maintained by hand.
It is hard to ensure that the stubs and definitions are up-to-date and correct.
One complication is the difference in alignment rules.
On i386 uint64_t has a 32bit alignment, but on AMD64 it uses natural (64bit) alignment.
This and the resulting padding introduced by the compiler can create hard to find bugs.


* replace the manual labour with an automatic tool
> > This tool should allow both verification / generation of structure definitions for use in netbsd32 code 
> > allow generation of system call stubs and conversion functions.
> > Generated stubs should also ensure that no kernel stack data is leaked in hidden padding without having to resort to unnecessary large memset calls.

For this purpose, the [Clang C parser]( or the [libclang frontend]( can be used to analyse the C code.

[[!tag gsoc]]

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb