Displaying 9 results from an estimated 9 matches for "selfmag".
Did you mean:
elfmag
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...CTIONS];
unsigned num = 0;
@@ -916,20 +1068,45 @@ static void handle_input(int fd, int chi
}
}
+static unsigned long load_elf_header(unsigned char *elf_nident)
+{
+ errno = 0;
+ switch (*(elf_nident+EI_CLASS)) {
+ case ELFCLASS32:
+ finish = finish32;
+ if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0)
+ return (unsigned long)map_elf32;
+ else
+ return (unsigned long)load_bzimage;
+ break;
+ case ELFCLASS64:
+ finish = finish64;
+ if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0)
+ return (unsigned long)map_elf64;
+ else
+ return (unsigned long)load_bzimage;
+ break;
+...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...CTIONS];
unsigned num = 0;
@@ -916,20 +1068,45 @@ static void handle_input(int fd, int chi
}
}
+static unsigned long load_elf_header(unsigned char *elf_nident)
+{
+ errno = 0;
+ switch (*(elf_nident+EI_CLASS)) {
+ case ELFCLASS32:
+ finish = finish32;
+ if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0)
+ return (unsigned long)map_elf32;
+ else
+ return (unsigned long)load_bzimage;
+ break;
+ case ELFCLASS64:
+ finish = finish64;
+ if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0)
+ return (unsigned long)map_elf64;
+ else
+ return (unsigned long)load_bzimage;
+ break;
+...
2003 Jan 07
1
klibc-0.72 released
This adds [f]getc() and fgets() for parsing config files. Probably hard
to avoid. Still trying to decide if I actually want to add system() or not.
-hpa
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...zero");
+
+ mem = memparse(argv[1]);
+ kern_fd = open(argv[2], O_RDONLY, 0);
+ if (kern_fd < 0)
+ err(1, "Opening %s", argv[2]);
+
+ if (read(kern_fd, &hdr, sizeof(hdr)) != sizeof(hdr))
+ err(1, "Reading %s elf header", argv[2]);
+
+ if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0)
+ load = map_elf;
+ else
+ load = load_bzimage;
+
+ devices.max_infd = -1;
+ devices.dev = NULL;
+ FD_ZERO(&devices.infds);
+
+ devdescs = map_pages(mem, 1);
+ arg = 3;
+ while (argv[arg] && argv[arg][0] == '-') {
+ const char *argval;
+
+ if ((argval = get_arg(argv[a...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...zero");
+
+ mem = memparse(argv[1]);
+ kern_fd = open(argv[2], O_RDONLY, 0);
+ if (kern_fd < 0)
+ err(1, "Opening %s", argv[2]);
+
+ if (read(kern_fd, &hdr, sizeof(hdr)) != sizeof(hdr))
+ err(1, "Reading %s elf header", argv[2]);
+
+ if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0)
+ load = map_elf;
+ else
+ load = load_bzimage;
+
+ devices.max_infd = -1;
+ devices.dev = NULL;
+ FD_ZERO(&devices.infds);
+
+ devdescs = map_pages(mem, 1);
+ arg = 3;
+ while (argv[arg] && argv[arg][0] == '-') {
+ const char *argval;
+
+ if ((argval = get_arg(argv[a...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...fset);
+ }
+ }
+ errx(1, "Could not find kernel in bzImage");
+}
+
+static unsigned long load_kernel(int fd, unsigned long *page_offset)
+{
+ Elf32_Ehdr hdr;
+
+ if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr))
+ err(1, "Reading kernel");
+
+ if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0)
+ return map_elf(fd, &hdr, page_offset);
+
+ return load_bzimage(fd, page_offset);
+}
+
+static inline unsigned long page_align(unsigned long addr)
+{
+ return ((addr + getpagesize()-1) & ~(getpagesize()-1));
+}
+
+/* initrd gets loaded at top of memory: return length. */
+static un...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...fset);
+ }
+ }
+ errx(1, "Could not find kernel in bzImage");
+}
+
+static unsigned long load_kernel(int fd, unsigned long *page_offset)
+{
+ Elf32_Ehdr hdr;
+
+ if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr))
+ err(1, "Reading kernel");
+
+ if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0)
+ return map_elf(fd, &hdr, page_offset);
+
+ return load_bzimage(fd, page_offset);
+}
+
+static inline unsigned long page_align(unsigned long addr)
+{
+ return ((addr + getpagesize()-1) & ~(getpagesize()-1));
+}
+
+/* initrd gets loaded at top of memory: return length. */
+static un...
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all,
These are the patches I'm planning to submit for 2.6.24. Comments
gratefully accepted. Along with the usual cleanups and improvements are Jes'
de-i386-ification patches, and a new "virtio" mechanism designed to be shared
with KVM (and hopefully other hypervisors).
Cheers,
Rusty.
Documentation/lguest/Makefile | 30
Documentation/lguest/lguest.c
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all,
These are the patches I'm planning to submit for 2.6.24. Comments
gratefully accepted. Along with the usual cleanups and improvements are Jes'
de-i386-ification patches, and a new "virtio" mechanism designed to be shared
with KVM (and hopefully other hypervisors).
Cheers,
Rusty.
Documentation/lguest/Makefile | 30
Documentation/lguest/lguest.c