diff --git a/Makefile b/Makefile index ddccd6d..9f61eb8 100644 --- a/Makefile +++ b/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 diff --git a/bin/elf2coff/main.c b/bin/elf2coff/main.c new file mode 100644 index 0000000..db9b811 --- /dev/null +++ b/bin/elf2coff/main.c @@ -0,0 +1,61 @@ +#include +#include +#include +#ifndef __stupidos__ +# include +#endif +#include +#include + +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); +} diff --git a/tools/Makefile b/tools/Makefile index 01306c3..a191088 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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) diff --git a/tools/coff2elf/main.c b/tools/coff2elf/main.c deleted file mode 100644 index 43c0c50..0000000 --- a/tools/coff2elf/main.c +++ /dev/null @@ -1 +0,0 @@ -#include