chore: add dummy elf2coff file
This commit is contained in:
parent
6cf0c63cf4
commit
7fec5d45f6
6
Makefile
6
Makefile
|
@ -27,7 +27,10 @@ LDFLAGS =
|
|||
QEMU_COMMON = \
|
||||
-rtc base=localtime \
|
||||
-vga cirrus \
|
||||
-serial mon:stdio
|
||||
-serial stdio \
|
||||
-monitor telnet::4545,server,nowait \
|
||||
-net nic,model=ne2k_isa \
|
||||
-machine isapc
|
||||
|
||||
SUBDIRS := external tools include boot kernel modules lib bin
|
||||
|
||||
|
@ -92,7 +95,6 @@ run: all
|
|||
-drive file=floppy1440.img,if=none,format=raw,id=boot \
|
||||
-drive file=fat:rw:./sysroot,if=none,id=hdd \
|
||||
-device floppy,drive=boot \
|
||||
-device ide-hd,drive=hdd \
|
||||
-global isa-fdc.bootindexA=0
|
||||
|
||||
.PHONY: run-iso
|
||||
|
|
61
bin/elf2coff/main.c
Normal file
61
bin/elf2coff/main.c
Normal file
|
@ -0,0 +1,61 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#ifndef __stupidos__
|
||||
# include <libgen.h>
|
||||
#endif
|
||||
#include <coff.h>
|
||||
#include <elf.h>
|
||||
|
||||
static const char *prg_name;
|
||||
|
||||
static void
|
||||
usage(int retval)
|
||||
{
|
||||
if (retval == EXIT_FAILURE)
|
||||
{
|
||||
fprintf(stderr, "Try '%s -h' for more informations.", prg_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Usage: %s [OPTIONS...] [FILES]\n", prg_name);
|
||||
printf("Options are:\n");
|
||||
}
|
||||
|
||||
exit(retval);
|
||||
}
|
||||
|
||||
static void
|
||||
version(void)
|
||||
{
|
||||
printf("%s (%s) %s", prg_name, MK_PACKAGE, MK_COMMIT);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
#ifndef __stupidos__
|
||||
prg_name = basename(argv[0]);
|
||||
#else
|
||||
prg_name = argv[0];
|
||||
#endif
|
||||
|
||||
while ((argc > 1) && (argv[1][0] == '-'))
|
||||
{
|
||||
switch (argv[1][1])
|
||||
{
|
||||
case 'h':
|
||||
usage(EXIT_SUCCESS);
|
||||
break;
|
||||
case 'V':
|
||||
version();
|
||||
break;
|
||||
}
|
||||
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
TARGET = fat$(EXEXT) coff-ld$(EXEXT) parted$(EXEXT) readcoff$(EXEXT)
|
||||
TARGET = fat$(EXEXT) coff-ld$(EXEXT) parted$(EXEXT) readcoff$(EXEXT) elf2coff$(EXEXT)
|
||||
|
||||
.PHONY: all
|
||||
all: $(TARGET)
|
||||
|
@ -12,6 +12,9 @@ coff-ld$(EXEXT): ../bin/ld/main.c
|
|||
readcoff$(EXEXT): ../bin/readcoff/main.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
elf2coff$(EXEXT): ../bin/elf2coff/main.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
parted$(EXEXT): ../sbin/parted/main.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#include <coff.h>
|
Loading…
Reference in a new issue