The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/port/mkrootc

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #!/bin/rc
    2 
    3 rfork e
    4 n=`{echo $#*^'%3' | hoc}
    5 if(! ~ $n 0){
    6         echo 'usage: mkrootc [name cname file]...' >[1=2]
    7         exit usage
    8 }
    9 
   10 tmp=mkroot.$pid.out
   11 fn sigexit {
   12         rm -f $tmp
   13 }
   14 
   15 allcname=()
   16 allname=()
   17 while(! ~ $#* 0){
   18         name=$1
   19         cname=$2
   20         file=$3
   21         shift
   22         shift 
   23         shift
   24         allname=($allname $name)
   25         allcname=($allcname $cname)
   26 }
   27 
   28 echo '
   29 #include "u.h"
   30 #include "../port/lib.h"
   31 #include "mem.h"
   32 #include "dat.h"
   33 #include "fns.h"
   34 #include "io.h"
   35 #include "../port/error.h"
   36 '
   37 
   38 for(i in $allcname){
   39         echo 'extern uchar '$i'code[];'
   40         echo 'extern ulong '$i'len;'
   41 }
   42 
   43 echo '
   44 void bootlinks(void){
   45 '
   46 x=($allname)
   47 for(i in $allcname){
   48         name=$x(1)
   49         *=($x); shift; x=($*)
   50         echo '  addbootfile("'$name'", '$i'code, '$i'len);'
   51 }
   52 echo '
   53 }
   54 '

Cache object: 023313d92a7d3f07f452adf58589c262


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.