From c59c69a85ffae6013bcfd63216f6436e2afa3c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Moln=C3=A1r?= Date: Tue, 20 Feb 2007 13:49:18 +0100 Subject: [PATCH] p_exe.cpp: added some comments --- src/p_exe.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/p_exe.cpp b/src/p_exe.cpp index 3ab554a9..ae17c273 100644 --- a/src/p_exe.cpp +++ b/src/p_exe.cpp @@ -755,6 +755,42 @@ Linker* PackExe::newLinker() const return new ElfLinkerX86(); } +/* + +memory layout at decompression time +=================================== + +normal exe +---------- + +a, at load time + +(e - copying code, C - compressed data, d - decompressor+relocator, + x - not specified, U - uncompressed code+data, R uncompressed relocation) + +eeCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCdddd +^ CS:0 ^ SS:0 + +b, after copying + +xxxxxxxxxxxxxxxCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCdddd +^ES:DI=0 ^ DS:SI=0 ^ CS=SS, IP in range 0..0xf + +c, after uncompression + +UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUURRdddd + ^ ES:DI + +device driver +------------- + +the file has 2 entry points, CS:0 in device driver mode, and +CS:exe_as_device_entry in normal mode. the code in section DEVICEENTRY +sets up the same environment for section EXEENTRY, as it would see in normal +execution mode. + +*/ + /* vi:ts=4:et