[syslinux] SYSLINUX 2.09-pre2

Murali Krishnan Ganapathy gmurali at cs.uchicago.edu
Tue Feb 3 08:34:57 PST 2004


TenThumbs wrote:

> ganapathy murali krishnan wrote:
>  
>
>> OK. I have removed all the bright/flashing parts in the attr. I had in
>> sometime ago for some test, I forgot to remove them.
>>
>> - Murali
>>
>>   
>
>
> I hope I didn't offend you. I didn't mean to disparage your 
> achievement. It's
> wonderful.
>
> Some suggestions if you don't mind.
> I'm using gcc on Linux and gcc does not pack items in a structure by 
> default.
> It might be a good idea to rearrange the structures so that larger 
> objects
> come before smaller ones, i.e. 4 byte objects before 2 byte one before 
> singel
> ones like chars.
>  
>
Good idea. I will do that today / tomorrow.

> I also noticed that a t_menusystem object is 21260 bytes because it 
> has 10
> t_menu items which each have t_menuitem objects wich are 208 bytes. 
> That's a
> lot of space in a com file. Is 10x10 necessary? Perhaps 8x8.
>  
>
This size is determined by how much space you want for your menu. All 
these are controlled through #defines in menu.h. Feel free to reduce 
them as to your liking. I just picked those defaults, since in my 
example complex.c (which uses some call back functions and stuff) I 
needed it that long.

> I also see that you've assumed a 80x25 screen. Maybe in a future 
> version you
> shouldn't although that's probably hard without some kind of malloc.
>  
>
My next step is to move all the 80 and 25 in the code as a parameter 
into the menusystem object, which gets initialised at startup. After 
that it should work in any text mode without any problem. Ofcourse I am 
assuming that the text mode is not so large that you dont have two 
display pages, which will be the case with any machine today. One thing 
should be pointed out is that all this will probably fail horribly if 
you are using a serial console.

Having a malloc will eliminate the need to hard code all the limits 
(MENULEN, MAXMENUS,....). On the other hand, I will have a tough time 
casting pointers back and forth from far * to near *.

A question for Peter. It should not be difficult to implement a memory 
manager which uses the memory inbetween the text segment and the stack? 
In which case, the memory allocation routine will only need to return 
near pointers. Since we have 64K of memory, and the code size is 4K and 
the stack should not grow more than a few K (all pointers passed 
around), there should be more than enough space to allocate space for 
the menusystem (current max about 20K).
- Murali




More information about the Syslinux mailing list