From: Fokkema DOT DBRA AT delorie DOT com, 1043730 Newsgroups: comp.os.msdos.djgpp Subject: Re: size of _text+_data Date: Tue, 5 Oct 1999 08:36:51 GMT Organization: Fac. Wiskunde & Informatica, VU, Amsterdam Lines: 25 Message-ID: <7tcdb3$6gf@cs.vu.nl> References: <7t58e3$csm AT cs DOT vu DOT nl> NNTP-Posting-Host: galjas.cs.vu.nl X-Newsreader: TIN [version 1.2 PL2] X-Poster-Key: sha1:NDqtCcuJrIiLASNTd2Ot+mvYVPY= Cancel-Lock: sha1:RfYTR1WeT55qDH/DWHseZ1hGRzc= To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I know about headers and stuff, but I'm writing my os to a plain binary file (no header or anything that even looks like it). So I _really_ need a way to know the size of the entire binary at link time, so my loader which is a part of the binary itself, knows how many bytes to load from disk. I don't want to patch the binary later. But maybe somebody knows another way of doing this? All thoughts are welcome. David Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote: : On Sat, 2 Oct 1999 Fokkema DOT DBRA AT delorie DOT com wrote: : > You helped me very much with my far pointer problem (thank you all) so here : > is another question: for my os, I link a loader along with it at the start : > of the binary image. So on booting the floppy, the loader takes over and has : > to load the entire kernel from disc. But how can the loader know the size of : > the entire kernel? : The size of every section is usually recorded in the header of the : binary file. Each binary file format has its own way of recording : this information; check out the `size' program from GNU Binutils which : reports the size of each section.