bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ANNOUNCE: limited tagged image support for grub (0.93)


From: Hans-Peter Jansen
Subject: ANNOUNCE: limited tagged image support for grub (0.93)
Date: Fri, 1 Aug 2003 00:33:15 +0200
User-agent: KMail/1.5.1

Hi *,

here's a reworked and debugged implementation of the tagged image format
for grub. It currently lacks one exotic relocation scheme, and the ability 
to execute returning images (mainly because of grubs memory layout)...

The patch below also includes some useful low level debugging stuff in 
asm.S, currently covered by a local #define, but could be useful in other 
areas as well. I've kept it for discussion purposes, since my i386 assembler
knowledge is a bit rusty at best.

I've tried to follow grub's coding style most of the time.

BTW: is there somebody out there really interested in this stuff?

Pleace, love & happiness,
Pete

--- ../grub-0.93/netboot/main.c 2002-06-12 10:58:18.000000000 +0200
+++ netboot/main.c      2003-07-29 01:18:36.000000000 +0200
@@ -49,14 +49,14 @@
 int ip_abort = 0;
 /* Set if an ethernet card is probed and IP addresses are set.  */
 int network_ready = 0;
 
 struct rom_info rom;
+struct bootpd_t bootp_data;
 
 static int vendorext_isvalid;
 static unsigned long netmask;
-static struct bootpd_t bootp_data;
 static unsigned long xid;
 static unsigned char *end_of_rfc1533 = NULL;
 
 #ifndef        NO_DHCP_SUPPORT
 #endif /* NO_DHCP_SUPPORT */
--- stage2/asm.S.orig   2003-07-31 22:06:02.000000000 +0200
+++ stage2/asm.S        2003-07-31 22:08:31.000000000 +0200
@@ -1720,11 +1720,422 @@
        DATA32  jmp     pc_stop
 ENTRY(patch_code_end)
 
        .code32
 
+#if TAGGED_IMAGE_DEBUG
+/*
+ * hex dump
+ *
+ * void hexdump(const char *msg, void *p, unsigned int len);
+ */
+ENTRY(hexdump)
+       pushl   %eax                    /* save used */
+       pushl   %ebx
+       pushl   %ecx
+       pushl   %edx
+       pushl   %edi
+       movl    24(%esp), %eax          /* msg */
+       testl   %eax, %eax              /* any? */
+       je      hd_nomsg
+       pushl   %eax                    /* print message */
+       call    EXT_C(console_print)
+       pushl   $r_nl                   /* newline */
+       call    EXT_C(console_print)
+       addl    $8, %esp
+hd_nomsg:
+       movl    $EXT_C(h_buf), %edi     /* ascii buffer */
+       movl    28(%esp), %ecx          /* p */
+       movl    32(%esp), %ebx          /* len */
+       jmp     hd_nextline             /* enter loop */
+
+hd_outerloop:
+       pushl   %ecx                    /* address label */
+       call    EXT_C(console_print_int)
+
+       pushl   $0x3a                   /* colon */
+       call    EXT_C(console_putchar)
+
+       pushl   $r_sep                  /* separator */
+       call    EXT_C(console_print)
+       addl    $12, %esp
+
+       xorl    %edx, %edx              /* line index */
+hd_innerloop:
+       testl   %ebx, %ebx              /* finished? */
+       je      hd_lastline
+       movb    (%ecx, %edx), %al       /* grab value */
+       pushl   %eax                    /* keep value on stack */
+       call    EXT_C(console_print_byte)
+       pushl   %edx                    /* clobbered by console_putchar */
+       pushl   $0x20                   /* extra blank */
+       call    EXT_C(console_putchar)
+       addl    $4, %esp
+       popl    %edx
+       popl    %eax                    /* restore value */
+       cmpb    $0x20, %al              /* printable ascii */
+       jl      hd_subdot
+       cmpb    $0x7f, %al              /* < DEL */
+       jl      hd_asciiok
+hd_subdot:
+       movb    $0x2e, %al              /* subst. with '.' */
+hd_asciiok:
+       movb    %al, (%edi, %edx)       /* -> ascii value */
+       decl    %ebx                    /* len -= 1 */
+       incl    %edx                    /* index += 1 */
+
+       cmp     $8, %edx                /* half time? */
+       jne     hd_noegap
+       pushl   %edx                    /* clobbered by console_putchar */
+       pushl   $0x20                   /* extra blank */
+       call    EXT_C(console_putchar)
+       addl    $4, %esp
+       popl    %edx
+hd_noegap:
+       movl    $16, %eax               /* bytes per line */
+       cmp     %eax, %edx              /* line done? */
+       jl      hd_innerloop
+       addl    %eax, %ecx              /* advance p */
+       jmp     hd_putascii
+
+hd_lastline:                           /* last line */
+       movb    $0, (%edi, %edx)        /* end of ascii */
+
+       movl    $16, %eax               /* calc. gab */
+       subl    %edx, %eax              /* # of bytes */
+       movl    %eax, %ecx              /* not used anymore */
+       addl    %eax, %eax
+       addl    %ecx, %eax              /* # of bytes * 3 */
+
+       cmpl    $8, %edx                /* extra gab? */
+       jae     hd_noegab2
+       incl    %eax
+hd_noegab2:
+       movl    %eax, %ecx              /* fill with blanks */
+       pushl   %edx                    /* clobbered by console_putchar */
+hd_fillgab:
+       pushl   $0x20
+       call    EXT_C(console_putchar)
+       addl    $4, %esp
+       loop    hd_fillgab
+       popl    %edx
+hd_putascii:
+       pushl   $r_sep                  /* separator */
+       call    EXT_C(console_print)
+
+       pushl   %edi                    /* ascii part */
+       call    EXT_C(console_print)
+
+       pushl   $r_nl                   /* newline */
+       call    EXT_C(console_print)
+       addl    $12, %esp
+hd_nextline:
+       testl   %ebx, %ebx              /* anything left? */
+       jne     hd_outerloop
+
+       popl    %edi                    /* restore used */
+       popl    %edx
+       popl    %ecx
+       popl    %ebx
+       popl    %eax
+       ret
+
+VARIABLE(h_buf)
+       .string "1234567890123456"
+/*
+ * register dump
+ *
+ * void regdump(void);
+ */
+
+VARIABLE(r_msg)
+       .string "cs: "
+       .string "ds: "
+       .string "es: "
+       .string "ss: "
+
+VARIABLE(er_msg)
+       .string "eax: "
+       .string "ebx: "
+       .string "ecx: "
+       .string "edx: "
+       .string "edi: "
+       .string "esi: "
+       .string "ebp: "
+       .string "esp: "
+
+VARIABLE(r_sep)
+       .string "  "
+
+VARIABLE(r_nl)
+       .string "\r\n"
+
+ENTRY  (regdump)
+       pushl   %eax    /* save used */
+       pushl   %ebx
+       pushl   %ecx
+       pushl   %edx
+
+       push    %ss     /* push regs in reverse order */
+       push    %es
+       push    %ds
+       push    %cs
+       pushl   %esp
+       pushl   %ebp
+       pushl   %esi
+       pushl   %edi
+       pushl   %edx
+       pushl   %ecx
+       pushl   %ebx
+       pushl   %eax
+
+       movl    $EXT_C(r_nl), %edx          /* line break */
+       movl    $EXT_C(er_msg), %ebx
+       movw    $8, %cx
+       pushl   %edx
+       call    EXT_C(console_print)
+       add     $4, %esp
+1:     push    %ebx
+       call    EXT_C(console_print)
+       add     $4, %esp
+       call    EXT_C(console_print_int)
+       add     $4, %esp                    /* consume pushed regs */
+       addl    $6, %ebx                    /* advance reg label */
+       dec     %cx
+       testw   %cx, %cx                    /* finished? */
+       je      3f
+
+       cmp     $4, %cx                     /* half time? */
+       jne     2f
+       push    %edx                        /* line break */
+       call    EXT_C(console_print)
+       add     $4, %esp
+       jmp     1b                          /* loop */
+
+2:     pushl   $EXT_C(r_sep)               /* separator */
+       call    EXT_C(console_print)
+       add     $4, %esp
+       jmp     1b                          /* loop */
+
+3:     push    %edx                        /* line break */
+       call    EXT_C(console_print)
+       add     $4, %esp
+
+       movl    $EXT_C(r_msg), %ebx
+       movw    $4, %cx
+
+4:     pushl   %ebx
+       call    EXT_C(console_print)
+       add     $4, %esp
+       call    EXT_C(console_print_short)  /* consume pushed regs */
+       add     $4, %esp
+       add     $5, %ebx                    /* advance reg label */
+       dec     %cx
+       testw   %cx, %cx                    /* finished? */
+       je      5f
+       pushl   $EXT_C(r_sep)               /* separator */
+       call    EXT_C(console_print)
+       add     $4, %esp
+       jmp     4b                          /* loop */
+
+5:     pushl   %edx                        /* line break */
+       call    EXT_C(console_print)
+       add     $4, %esp
+
+       popl    %edx
+       popl    %ecx
+       popl    %ebx
+       popl    %eax
+       ret
+
+ENTRY  (byte2hex)
+       movb    %al, %ah
+       andb    $0xf, %al
+       addb    $0x30, %al
+       cmpb    $0x39, %al
+       jle     1f
+       addb    $0x27, %al
+1:     xchgb   %al, %ah
+       shrb    $4, %al
+       andb    $0xf, %al
+       addb    $0x30, %al
+       cmpb    $0x39, %al
+       jle     2f
+       addb    $0x27, %al
+2:     ret
+
+ENTRY  (console_print_byte)
+       pushl   %eax
+       pushl   %edx    /* clobbered by console_putchar */
+       mov     12(%esp), %eax
+       call    EXT_C(byte2hex)
+       pushw   %ax
+       andl    $0xff, %eax
+       pushl   %eax
+       call    EXT_C(console_putchar)
+       add     $4, %esp
+       popw    %ax
+       movb    %ah, %al
+       andl    $0xff, %eax
+       push    %eax
+       call    EXT_C(console_putchar)
+       add     $4, %esp
+       popl    %edx
+       popl    %eax
+       ret
+
+ENTRY  (console_print_short)
+       pushl   %eax
+       movl    8(%esp), %eax
+       movb    %ah, %al
+       pushl   %eax
+       call    EXT_C(console_print_byte)
+       add     $4, %esp
+       movl    8(%esp), %eax
+       pushl   %eax
+       call    EXT_C(console_print_byte)
+       addl    $4, %esp
+       popl    %eax
+       ret
+
+ENTRY  (console_print_int)
+       pushl   %eax
+       movw    10(%esp), %ax
+       pushl   %eax
+       call    EXT_C(console_print_short)
+       add     $4, %esp
+       movw    8(%esp), %ax
+       pushl   %eax
+       call    EXT_C(console_print_short)
+       add     $4, %esp
+       popl    %eax
+       ret
+
+ENTRY  (console_print)
+       pushl   %eax
+       pushl   %ebx
+       pushl   %edx    /* clobbered by console_putchar */
+       movl    16(%esp), %ebx
+       jmp     2f
+1:     pushl   %eax
+       call    EXT_C(console_putchar)
+       add     $4, %esp
+       inc     %ebx
+2:     xorl    %eax, %eax
+       movb    (%ebx), %al
+       testb   %al, %al
+       jne     1b
+       popl    %edx
+       popl    %ebx
+       popl    %eax
+       ret
+
+ENTRY  (console_hitkey)
+       pushl   %eax
+       pushl   %edx
+       pushl   $EXT_C(hitkey)
+       call    EXT_C(console_print)
+       call    EXT_C(console_getkey)
+       pushl   $EXT_C(hitkey_rub)
+       call    EXT_C(console_print)
+       addl    $8, %esp
+       popl    %edx
+       popl    %eax
+       ret
+
+VARIABLE(hitkey)
+       .string "<key>"
+VARIABLE(hitkey_rub)
+       .string "\b\b\b\b\b     \b\b\b\b\b"
+
+#endif /* TAGGED_IMAGE_DEBUG */
+
+#ifdef SUPPORT_NETBOOT
+/*
+ * taggedimg_boot()
+ *
+ * Does some funky things and then jumps to the entry point
+ */
+VARIABLE(taggedimg_setup)
+       .long   0
+
+VARIABLE(taggedimg_setup_length)
+       .long   0
+
+VARIABLE(taggedimg_entry)
+       .long   0
+
+VARIABLE(taggedimg_bootp)
+       .long   0
+
+ENTRY(taggedimg_boot)
+       /* don't worry about saving anything, we're committed at this point */
+       cld     /* forward copying */
+
+       /* copy setup segment, if necessary */
+       movl    EXT_C(taggedimg_setup_length), %ecx
+       testl   %ecx, %ecx
+       je      no_rm_copy
+       addl    $3, %ecx
+       shrl    $2, %ecx
+       movl    $TAGGED_IMAGE_HIGHMEM, %esi
+       movl    $TAGGED_IMAGE_BASEMEM, %edi
+       rep
+       movsl
+
+no_rm_copy:
+       /* prepare ljmp */
+       movl    EXT_C(taggedimg_entry), %eax
+       movl    %eax, taggedimg_jmp
+
+       /* XXX new stack pointer in safe area for calling functions */
+       movl    $TAGGED_IMAGE_STACK, %esp
+       pushl   $0
+       call    EXT_C(gateA20)
+       addl    $4, %esp
+       call    EXT_C(stop_floppy)
+
+       /* final setup for tagged image boot */
+
+       movl    EXT_C(taggedimg_setup), %ebx
+       /* convert *BOOTP_DATA_ADDR to seg:off */
+       movl    EXT_C(taggedimg_bootp), %ecx
+       shll    $12, %ecx
+       shrw    $12, %cx
+
+#if TAGGED_IMAGE_DEBUG
+       call    EXT_C(regdump)
+       call    EXT_C(console_hitkey)
+#endif
+
+       call    EXT_C(prot_to_real)
+       .code16
+
+       /* final setup for tagged image boot */
+       cli
+       movw    %bx, %ss
+       movl    $TAGGED_IMAGE_STACK, %esp
+       
+       movw    %bx, %ds
+       movw    %bx, %es
+       movw    %bx, %fs
+       movw    %bx, %gs
+
+       pushl   %ecx            /* taggedimg_bootp */
+       pushl   %ebx            /* taggedimg_setup */
+       pushl   EXT_C(stop)     /* in case of return */
+
+       /* jump to start */
+3:
+       /* ljmp */
+       .byte   0xea
+taggedimg_jmp: 
+       .long   0
+       .code32
 
+#endif /* SUPPORT_NETBOOT */
+ 
 /*
  * linux_boot()
  *
  * Does some funky things (including on the stack!), then jumps to the
  * entry point of the Linux setup code.
--- ../grub-0.93/stage2/boot.c  2002-11-30 18:29:16.000000000 +0100
+++ stage2/boot.c       2003-07-31 21:51:59.000000000 +0200
@@ -23,10 +23,27 @@
 
 #include "freebsd.h"
 #include "imgact_aout.h"
 #include "i386-elf.h"
 
+#ifdef SUPPORT_NETBOOT
+# define GRUB 1
+# include <etherboot.h>
+
+/* Keep all context about loaded image in one place */
+static struct tagged_context    tctx;
+
+#define TAGGED_PROGRAM_RETURNS  (tctx.img.length & 0x00000100)  /* bit 8 */
+#define LINEAR_EXEC_ADDR        (tctx.img.length & 0x80000000)  /* bit 31 */
+
+static struct ebinfo            loaderinfo = {
+        5,0, /* VERSION_MAJOR, VERSION_MINOR, */
+        0
+};
+
+#endif /* SUPPORT_NETBOOT */
+
 static int cur_addr;
 entry_func entry_addr;
 static struct mod_list mll[99];
 static int linux_mem_size;
 
@@ -89,10 +106,126 @@
          str2 = "Multiboot";
          break;
        }
     }
 
+#ifdef SUPPORT_NETBOOT
+
+  /* check for tagged image */
+  if ((type == KERNEL_TYPE_NONE) && (*((unsigned long *)buffer) == 
TAGGED_MAGIC))
+    {
+      type = KERNEL_TYPE_TAGGEDIMAGE;
+      str2 = "Tagged Image";
+      taggedimg_setup = NULL;
+      taggedimg_setup_length = 0;
+      taggedimg_entry = NULL;
+      taggedimg_bootp = NULL;
+      printf("Netboot Tagged Image Format detected\n");
+
+      /* Zero all context info */
+      grub_memset(&tctx, 0, sizeof(tctx));
+      /* Copy first 4 longwords */
+      grub_memmove(&tctx.img, buffer, sizeof(tctx.img));
+      /* Memory location where we are supposed to save it */
+      tctx.segaddr = tctx.linlocation = ((tctx.img.u.segoff.ds) << 4)
+                                        + tctx.img.u.segoff.bx;
+
+      /* Grab a copy */
+      if (tctx.segaddr < TAGGED_IMAGE_BASEMEM_LIMIT) {
+         /* We won't overwrite grub, move stuff to a temporary location */
+         tctx.segaddr += TAGGED_IMAGE_HIGHMEM_OFFSET;
+         taggedimg_setup_length = 512;
+      }
+      grub_memmove((void *)tctx.segaddr, buffer, 512);
+      tctx.segaddr += ((tctx.img.length & 0x0F) << 2) +
+                     ((tctx.img.length & 0xF0) >> 2);
+
+      grub_seek(512);
+      len = 512;
+
+      while (1) 
+       {
+         if (tctx.seglen == 0) {
+           struct segheader sh;
+           if (tctx.segflags & 0x04) {
+             if (TAGGED_PROGRAM_RETURNS) {
+               printf("Warning: returning images not supported\n");
+               type = KERNEL_TYPE_NONE;
+               break;
+             }
+             if (LINEAR_EXEC_ADDR) {
+               type = KERNEL_TYPE_TAGGEDPMIMAGE;
+#if TAGGED_IMAGE_DEBUG
+               printf("PM image: %x(%x, %x, %x)\n", tctx.img.execaddr,
+                    &loaderinfo, tctx.linlocation, (char *) BOOTP_DATA_ADDR);
+#else
+               printf("%d K, start in protected mode\n", len >> 10);
+#endif
+             } else {
+               taggedimg_entry = (char *) tctx.img.execaddr;
+               taggedimg_setup = (char *) tctx.img.u.location;
+               taggedimg_bootp = (char *) BOOTP_DATA_ADDR;
+#if TAGGED_IMAGE_DEBUG
+               printf("RM image: entry: %x, setup: %x, bootp: %x\n",
+                       taggedimg_entry, taggedimg_setup, taggedimg_bootp);
+#else
+               printf("%d K, start in real mode\n", len >> 10);
+#endif
+             }
+             break;
+           }
+           sh = *((struct segheader *)tctx.segaddr);
+           tctx.seglen = sh.imglength;
+           if ((tctx.segflags = sh.flags & 0x03) == 0)
+                   cur_addr = sh.loadaddr;
+           else if (tctx.segflags == 0x01)
+                   cur_addr = tctx.last1 + sh.loadaddr;
+           else if (tctx.segflags == 0x02) {
+#if 0
+             cur_addr = (Address)(meminfo.memsize * 1024L + 0x100000L)
+                        - sh.loadaddr;
+#endif
+             printf("Addressing mode not supported\n");
+             type = KERNEL_TYPE_NONE;
+             break;
+           }
+           else
+             cur_addr = tctx.last0 - sh.loadaddr;
+           /* calc. segm. parameter */
+           tctx.last1 = (tctx.last0 = cur_addr) + sh.memlength;
+           tctx.segflags = sh.flags;
+           tctx.segaddr += ((sh.length & 0x0F) << 2)
+                   + ((sh.length & 0xF0) >> 2);
+         }
+#if TAGGED_IMAGE_DEBUG
+         printf("segaddr: %x, dest: %x, seglen: %d, segflags: %x\n",
+            tctx.segaddr, cur_addr, tctx.seglen, tctx.segflags);
+#endif
+         if (tctx.seglen) {
+             /* another segment */
+             if (cur_addr < TAGGED_IMAGE_BASEMEM_LIMIT) {
+                 cur_addr += TAGGED_IMAGE_HIGHMEM_OFFSET;
+                 taggedimg_setup_length = (cur_addr - TAGGED_IMAGE_HIGHMEM)
+                                          + tctx.seglen;
+             }
+             len += tctx.seglen;
+#if TAGGED_IMAGE_DEBUG
+             printf("read: %x, len: %d\n", cur_addr, tctx.seglen);
+#else
+             printf("%d K\r", len >> 10);
+#endif
+             grub_read((char *) RAW_ADDR(cur_addr), tctx.seglen);
+             tctx.seglen = 0;
+         } 
+         else break;
+       }
+      grub_close ();
+      return type;
+    }
+
+#endif /* SUPPORT_NETBOOT */
+
   /* Use BUFFER as a linux kernel header, if the image is Linux zImage
      or bzImage.  */
   lh = (struct linux_kernel_header *) buffer;
   
   /* ELF loading supported if multiboot, FreeBSD and NetBSD.  */
@@ -999,5 +1132,15 @@
       
       (*entry_addr) (clval, bootdev, 0, end_mark,
                     extended_memory, mbi.mem_lower);
     }
 }
+
+#ifdef SUPPORT_NETBOOT
+void taggedimg_pmboot(void)
+{
+  void (*entry)(struct ebinfo *, long, struct bootpd_t *);
+  entry = (void (*)())tctx.img.execaddr;
+  /* jump to it */
+  (*entry)(&loaderinfo, tctx.linlocation, BOOTP_DATA_ADDR);
+}
+#endif /* SUPPORT_NETBOOT */
--- stage2/builtins.c.orig      2003-07-31 22:06:11.000000000 +0200
+++ stage2/builtins.c   2003-07-31 22:10:42.000000000 +0200
@@ -295,10 +295,22 @@
     case KERNEL_TYPE_MULTIBOOT:
       /* Multiboot */
       multi_boot ((int) entry_addr, (int) &mbi);
       break;
 
+#ifdef SUPPORT_NETBOOT
+    case KERNEL_TYPE_TAGGEDIMAGE:
+      /* Tagged Image */
+      taggedimg_boot ();
+      break;
+
+    case KERNEL_TYPE_TAGGEDPMIMAGE:
+      /* Tagged PM Image */
+      taggedimg_pmboot ();
+      break;
+#endif
+
     default:
       errnum = ERR_BOOT_COMMAND;
       return 1;
     }
 
--- stage2/shared.h.orig        2003-07-31 22:45:53.000000000 +0200
+++ stage2/shared.h     2003-07-31 23:00:51.000000000 +0200
@@ -157,10 +157,19 @@
 #define LINUX_CL_OFFSET                        0x9000
 #define LINUX_CL_END_OFFSET            0x90FF
 #define LINUX_SETUP_MOVE_SIZE          0x9100
 #define LINUX_CL_MAGIC                 0xA33F
 
+#ifdef SUPPORT_NETBOOT
+#define TAGGED_IMAGE_DEBUG             0
+#define TAGGED_IMAGE_STACK             0x9000
+#define TAGGED_IMAGE_BASEMEM           0x10000
+#define TAGGED_IMAGE_BASEMEM_LIMIT     0x90000
+#define TAGGED_IMAGE_HIGHMEM_OFFSET    0xf0000
+#define TAGGED_IMAGE_HIGHMEM           0x100000
+#define TAGGED_MAGIC                   0x1b031336
+#endif /* SUPPORT_NETBOOT */
 /*
  *  General disk stuff
  */
 
 #define SECTOR_SIZE            0x200
@@ -488,10 +497,66 @@
   unsigned long max_pixel_clock;
 
   unsigned char reserved3[189];
 } __attribute__ ((packed));
 
+#ifdef SUPPORT_NETBOOT
+
+struct imgheader 
+{
+  unsigned long magic;
+  unsigned long length;                   /* and flags */
+  union
+  {
+    struct { unsigned short bx, ds; } segoff;
+    unsigned long location;
+  } u;
+  unsigned long execaddr;
+};
+
+struct segheader
+{
+  unsigned char length;
+  unsigned char vendortag;
+  unsigned char reserved; 
+  unsigned char flags;
+  unsigned long loadaddr;
+  unsigned long imglength;
+  unsigned long memlength;
+};
+
+struct tagged_context
+{
+  struct imgheader        img;                    /* copy of header */
+  unsigned long           linlocation;            /* addr of header */
+  unsigned long           last0, last1;           /* of prev segment */
+  unsigned long           segaddr, seglen;        /* of current segment */
+  unsigned char           segflags;
+};
+
+/* globals for real mode stub */
+
+extern char *taggedimg_setup;
+extern unsigned long taggedimg_setup_length;
+extern char *taggedimg_entry;
+extern char *taggedimg_bootp;
+
+#if TAGGED_IMAGE_DEBUG
+void console_print(char *);
+void console_print_byte(char);
+void console_print_short(short);
+void console_print_int(int);
+void console_hitkey(void);
+void regdump(void);
+void hexdump(const char *msg, void *p, unsigned int len);
+#endif /* TAGGED_IMAGE_DEBUG */
+
+/* do some funky stuff, then boot a tagged image */
+void taggedimg_boot (void) __attribute__ ((noreturn));
+void taggedimg_pmboot (void) __attribute__ ((noreturn));
+
+#endif /* SUPPORT_NETBOOT */
 
 #undef NULL
 #define NULL         ((void *) 0)
 
 /* Error codes (descriptions are in common.c) */
@@ -829,11 +894,15 @@
   KERNEL_TYPE_MULTIBOOT,       /* Multiboot.  */
   KERNEL_TYPE_LINUX,           /* Linux.  */
   KERNEL_TYPE_BIG_LINUX,       /* Big Linux.  */
   KERNEL_TYPE_FREEBSD,         /* FreeBSD.  */
   KERNEL_TYPE_NETBSD,          /* NetBSD.  */
-  KERNEL_TYPE_CHAINLOADER      /* Chainloader.  */
+  KERNEL_TYPE_CHAINLOADER,     /* Chainloader.  */
+#ifdef SUPPORT_NETBOOT
+  KERNEL_TYPE_TAGGEDIMAGE,     /* Netboot Tagged Image.  */
+  KERNEL_TYPE_TAGGEDPMIMAGE,   /* Netboot Tagged PM Image.  */
+#endif /* SUPPORT_NETBOOT */
 }
 kernel_t;
 
 extern kernel_t kernel_type;
 extern int show_menu;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]