Re: New GCC compiler for 8086 cpu's

Juan Perez-Sanchez <[email protected]> Mon, 19 Jun 2017 17:53:33 -0500
Newsgroups org.kernel.vger.linux-8086
Message-ID <CAD6VGuaTqUWDV5RDeiPiXqjcHik6FsJ2pSqoOSpNwSjz=xLkhA@mail.gmail.com>
On Mon, Jun 19, 2017 at 3:55 PM, Alan Cox <[email protected]> wrote:
> It doesn't work because you can take the address of a stack based object,
> and not only that the compiler will do so itself internally when
> generating code.
>

Of course, this is the kind of problems I expect to happen. To prevent
this case, one rule of the simple set of rules would be "Use automatic
variables only within the function where it is defined". Other may be
"Take the address of objects only if the object is defined in the DS
segment". It will be necessary a heap to allocate data in DS for you
example. The question is: using an adequate kmalloc() and a simple set
of rules, can we get a functional kernel?