web developer & system programmer

coder . cl

ramblings and rants on software development...


Print Article R -a +A

foreign system call emulations on freebsd

by Daniel Molina Wegener on 2009.07.19
posted in: c, freebsd, programming

Call simulations are common nowdays techniques to use foreign applications — build for other operating systems, such as M$ Windows — in the FreeBSD platform. The common technique is to create an interface to the real system calls replacing foreign system calls with wrappers on them. To build this task an assembler instruction is used. On call simulations we have the usage of win32 codecs, wine and valgrind — valgrind do not use foreign system calls, but replaces standard library routines. Most of them are using — behind all those system calls and standard library routines — a common assembler instruction: lldt. lldt stands for "Load Local Descriptor Table" and it’s related to Segment Descriptor Tables. This article is a lightweight introduction to the use of lldt assembler instruction.