I am attempting to add some functionality to the loader, but have come
across a minor problem.  Is there some way to include forth files,
given a string?

        s" file" included       (gforth example)

What I would like to do is read in a /boot/loader.rc.$ip or something
similar.  This would allow a number of machines to be booted diskless
and yet have different boot configurations.

Following, is my first forth attempt at such functionality.  If anyone
has any ideas, or would like to integrate something similar into one of
the 4th scripts, I would appreciate it. :)

Chris

: read_loader_rc_specific
  s" boot.netif.hwaddr" getenv
  dup -1 = if
    drop
    s" boot.netif.ip" getenv
    dup -1 = if
      drop 0 0
    then
  then
  s" /boot/loader.rc."
  2over nip over + allocate
  if ( out of memory )
    2drop 2drop
    100 exit
  then
  0 2swap strcat 2swap strcat
  read-conf
;


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to