Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,059 of 4,255    |
|    James Harris to wolfgang kern    |
|    Re: Format for the OS image    |
|    07 Feb 22 13:06:44    |
      From: james.harris.1@gmail.com              On 09/01/2022 10:44, wolfgang kern wrote:       > On 08/01/2022 23:44, James Harris wrote:       >> On 08/01/2022 20:10, wolfgang kern wrote:       >>       >> ...       >>       >>> Earlier versions of my OS used self-relocation, and they were small       >>> enough to fit into the first 640K. Not more since a while ...       >> What format did you use for relocatable files? AISI there are two       >> choices:       >>       >> 1. Design your own format. Then relocation would be easy but you'd       >> need some way to convert to that form from build tools -       >> compiler/assembler - or to produce your own build tools.       >>       >> 2. Use a predefined format. Then relocation would require parsing the       >> structure but (bugs permitting!) it would be easy to produce.       >>       >>       >> FWIW, I am looking to use option 2 ATM but I have all kinds of       >> interesting ideas for matters related to option 1. :-)       >       > My way of self relocation was just one single variable on the very start       > of the image in RAM (I put all other rd/wr data anyway 512 bytes upfront       > code, similar to a PSP in DOS), so all internal and also external access       > just added this to reference anything within code and data by SIB modes.              I don't get that. If you had instructions like               mov ebx, [0x7c00] ;Get pointer from start of image              then you would need to know where the image started (0x7c00) ... and if       you knew where the image started you wouldn't need relocation.              >       > more previous versions used a relative CALL-Null/POP sequence to figure       > where it was loaded, but I soon found the better solution as said above.              I could see value in loading a pointer from a fixed location in memory,       e.g.               mov ebx, [0x1004] ;Get pointer to globals              but not from the start of a movable image.                            --       James Harris              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca