From: Paolo G. <pao...@ev...> - 2003-03-19 15:02:35
|
Hi Luca, Hi Giacomo... what I really think about this issue is that the whole _startup function should be customizable by the user. That is, if we are using oslib only all remains like that, if we are using our kernel based on OsLib, we should be able to write our own _startup functions. In fact, if you remove the command line mangling part, it remains only a bios_save() and a bios_restore(). If this way is taken, there is no more need to have the "MAIN" define to use a predefined OsLib's main() function or the kernel's "init" function... what do you think about that??? the code would be something like the one in the bottom of the mail... and it seems in my opinion more simple... bye PJ xlib/x1.c ------------- [....] DWORD _stkbase; DWORD _stktop; /* This is some extra stuff we need to compile with argument */ /* passing and math extensions */ DWORD _argc = 0; typedef char *charp; charp _argv[100]; #ifndef NO_MAIN extern void main(int argc,char *argv[]); extern void bios_save(void); extern void bios_restore(void); /* This is used in GNU-C to implement C++ constructors/destructors */ /* See the lib sources for more details */ void __main(int argc, char **argv) { } struct multiboot_info * mbi_address(void) { /* This is declared in [wc32/gnu]\x0.[asm/s] */ extern struct multiboot_info *mbi; return (mbi); } void _startup(void) { [...] as now, but main and not MAIN at the end } #endif On Wed, 2003-03-19 at 15:09, Giacomo Guidi wrote: > I found that the cmdline inside the multiboot structure > is modified by the argc,argv elaboration > /oslib/xlib/x1.c > > function _startup(void) > > it cause a fail getting argc argv when the cmdline is reused outside > the oslib (ex: s.ha.r.k.) > > so I suggest this correction (diff) where I defined and use a temp var. -- ----------------------------------------------------------------------- Paolo Gai - ReTiS Lab - PhD Student Scuola Superiore S. Anna Tel : +39 050 883 451 Polo S. Anna Valdera Fax : +39 050 883 452 viale Rinaldo Piaggio 34 e-mail : pj...@ga... 56025 - Pontedera (PI) - ITALY home page : http://feanor.sssup.it/~pj ------------------------------------------------------------------------ Per favore non mandatemi allegati in Word o PowerPoint. (Please avoid sending me Word or PowerPoint attachments.) Si veda (See) http://www.fsf.org/philosophy/no-word-attachments.html ------------------------------------------------------------------------ |