Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 1997 15:43:17 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        hackers@freebsd.org
Subject:   mapping memory inside the kernel?
Message-ID:  <199704290613.PAA20132@genesis.atrad.adelaide.edu.au>

next in thread | raw e-mail | index | archive | help

A question for those familiar with the workings of the kernel wrt.
load-time and mappings;

If I want to load extra data after the kernel, and not have it clobbered
by the bss clearing in locore.s, how should this be done?

As I see it I can :

  - put the data after _edata, and copy it somewhere before the bss is 
    cleared.  (Yuck, requires a static buffer in the data segment).

  - put the data after _end, and copy it into a buffer in the bss
    (still yuck for a static buffer ripe for overflowing).

  - put the data after _end and adjust _end after the bss is cleared,
    saving the old _end value as a reference to this data.

  - put the data somewhere else (first meg somewhere?) and advertise
    its location in some fashion.  Perhaps the kernel flags should 
    become a physical address reference to a parameter block instead.
    This could be done in a backwards-compatible fashion I think.

Of these, I obviously like the third, although it requires some more 
structure on the part of the data (ie. more work on the part of the 
bootstrap loader).  I don't know how well this would work in conjunction
with compressed kernels though.

-- 
]] Mike Smith, Software Engineer        msmith@gsoft.com.au             [[
]] Genesis Software                     genesis@gsoft.com.au            [[
]] High-speed data acquisition and      (GSM mobile)     0411-222-496   [[
]] realtime instrument control.         (ph)          +61-8-8267-3493   [[
]] Unix hardware collector.             "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704290613.PAA20132>