[syslinux] mysteries of memdisk code

Loginov Alexander aloginov at asmpt.com
Tue Jun 17 23:56:05 PDT 2008


Andreas,

Thanks for your response. 

The memdisk's Makefile makes use of a default linker script. How can it
define variables named in such a project-specific way
(_binary_memdisk_bin_start, _binary_memdisk_bin_start,...)? I also
suspect that the trick is made at linking stage. But how? :)

Segmentation? Doesn't seem so because the segments for real-mode are
shifter by 4 bits...

Anyway, thanks.

Best regards,
Alex 


-----Original Message-----
From: syslinux-bounces at zytor.com [mailto:syslinux-bounces at zytor.com] On
Behalf Of Andreas Kotes
Sent: Wednesday, June 18, 2008 2:39 PM
To: For discussion of SYSLINUX and tftp-hpa
Subject: Re: [syslinux] mysteries of memdisk code

Hallo,

some wild guesses which may help you right now and may be clarified by
hpa later on:

* Loginov Alexander <aloginov at asmpt.com> [20080618 08:11]:
> 1)       _binary_memdisk_bin_start[], _binary_memdisk_bin_end[] and
> _binary_memdisk_bin_size[]; These variables are declared (as extern
> const chat in 'setup.c') but never defined in the code. Yet, it seems
> that somehow they are initialized with the size and start address of
> memdisk. How can it be?

most likely, the linker does that ... have a look at the linker script
and what happens in that area :)

> 2)       What is driverptr (declared in setup())? It is defined as
> driverptr = driverseg  << 16; Why is it shifted by 16-bits?

no idea what it is, but name and shifting seem to be related to
http://en.wikipedia.org/wiki/X86_memory_segmentation

Hope that helps you for the moment ...

   Andreas

-- 
flatline IT services - A.Kotes - IT-consulting for ISPs & Internet
services

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX at zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.




More information about the Syslinux mailing list