/branches/dynload/uspace/app/dltest/dltest.c |
---|
38,24 → 38,8 |
void __main(void); |
void __exit(void); |
static void kputint(unsigned i) |
{ |
unsigned dummy; |
asm volatile ( |
"movl $30, %%eax;" |
"int $0x30" |
: "=d" (dummy) /* output - %edx clobbered */ |
: "d" (i) /* input */ |
: "%eax","%ecx" /* all scratch registers clobbered */ |
); |
} |
static void test(void) |
{ |
kputint(-1); |
kputint(42); |
while(1); |
} |
int main(int argc, char *argv[]) |
/branches/dynload/uspace/app/iloader/main.c |
---|
55,7 → 55,7 |
printf("Load program\n"); |
rc = elf_load_file("/dltest", &prog_info); |
rc = elf_load_file("/tetris", &prog_info); |
if (rc < 0) { |
printf("failed to load program\n"); |
return 1; |
64,8 → 64,6 |
printf("Create PCB\n"); |
if (elf_create_pcb(&prog_info) < 0) return 1; |
getchar(); |
printf("Load dynamic linker\n"); |
file_name = "/rtld.so"; |
printf("open and read '%s'...\n", file_name); |
/branches/dynload/uspace/app/iramfs/data.h |
---|
41,9 → 41,9 |
extern const size_t rtld_size; |
extern const char rtld_filename[]; |
extern const uint8_t dltest[]; |
extern const size_t dltest_size; |
extern const char dltest_filename[]; |
extern const uint8_t tetris[]; |
extern const size_t tetris_size; |
extern const char tetris_filename[]; |
#endif |
/branches/dynload/uspace/app/iramfs/main.c |
---|
87,7 → 87,7 |
} while (1); |
if (write_file(rtld, rtld_size, rtld_filename) < 0) return 1; |
if (write_file(dltest, dltest_size, dltest_filename) < 0) return 1; |
if (write_file(tetris, tetris_size, tetris_filename) < 0) return 1; |
printf("done\n"); |
getchar(); |
/branches/dynload/uspace/app/iramfs/Makefile |
---|
87,6 → 87,6 |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
data.c: ../../lib/rtld/rtld.so ../dltest/dltest |
data.c: ../../lib/rtld/rtld.so ../tetris/tetris |
../../../tools/bin2c.py ../../lib/rtld/rtld.so rtld.so rtld >$@ |
../../../tools/bin2c.py ../dltest/dltest dltest dltest >>$@ |
../../../tools/bin2c.py ../tetris/tetris tetris tetris >>$@ |