|
@@ -40,9 +40,17 @@ type Syserror struct {
|
|
|
Id uint32
|
|
|
}
|
|
|
|
|
|
+type Bootmethods struct {
|
|
|
+ Name string
|
|
|
+ Config string
|
|
|
+ Connect string
|
|
|
+ Arg string
|
|
|
+}
|
|
|
+
|
|
|
type Sysconf struct {
|
|
|
Syscalls []Syscall
|
|
|
Syserrors []Syserror
|
|
|
+ Bootmethods []Bootmethods
|
|
|
}
|
|
|
|
|
|
var mode = flag.String("mode", "", "must be one of: sys.h, sysdecl.h, syscallfiles, systab.c, error.h, errstr.h, sys_harvey.s, sysnum.go")
|
|
@@ -85,6 +93,7 @@ func main() {
|
|
|
|
|
|
syscalls := sysconf.Syscalls
|
|
|
syserrors := sysconf.Syserrors
|
|
|
+ bootmethods := sysconf.Bootmethods
|
|
|
for i := range syscalls {
|
|
|
if syscalls[i].Define == "" {
|
|
|
syscalls[i].Define = strings.ToUpper(syscalls[i].Name)
|
|
@@ -283,6 +292,34 @@ int nsyscall = nelem(systab);
|
|
|
if err != nil {
|
|
|
log.Fatal(err)
|
|
|
}
|
|
|
+ case "bootk8cpu.c":
|
|
|
+ tmpl, err := template.New("bootk8cpu.c").Parse(`/* automatically generated by mksys */
|
|
|
+#include <u.h>
|
|
|
+#include <libc.h>
|
|
|
+
|
|
|
+#include "../boot/boot.h"
|
|
|
+
|
|
|
+Method method[] = {
|
|
|
+{{ range . }}{ "{{.Name}}", {{.Config}}, {{.Connect}}, "{{.Arg}}", },
|
|
|
+{{ end }}
|
|
|
+ { nil },
|
|
|
+};
|
|
|
|
|
|
+int cpuflag = 1;
|
|
|
+char* rootdir = "/root";
|
|
|
+char* bootdisk = "#S/sdC0/";
|
|
|
+extern void boot(int, char**);
|
|
|
+
|
|
|
+void
|
|
|
+main(int argc, char **argv)
|
|
|
+{
|
|
|
+ boot(argc, argv);
|
|
|
+}
|
|
|
+int (*cfs)(int) = 0;
|
|
|
+`)
|
|
|
+ err = tmpl.Execute(outfile, bootmethods)
|
|
|
+ if err != nil {
|
|
|
+ log.Fatal(err)
|
|
|
+ }
|
|
|
}
|
|
|
}
|