diff --git a/src/Makefile b/src/Makefile index 1cb6bbda88d6b1aed1d7df55c58be91e20716703..042bde18a9e177a366627e70691d208465d904d4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -46,11 +46,9 @@ task-descriptor.o: task-descriptor.s bwio.o: bwio.s $(AS) $(ASFLAGS) -o bwio.o bwio.s -clean: - -rm -f *.elf *.s *.o *.a *~ ../../lib/*.a main.elf: main.o scheduler.o task-descriptor.o scheduler.o bwio.o - $(LD) $(LDFLAGS) -o $@ main.o scheduler.o task-descriptor.o scheduler.o bwio.o -lgcc #-lbwio + $(LD) $(LDFLAGS) -o $@ main.o scheduler.o task-descriptor.o scheduler.o bwio.o -lgcc clean: - -rm -f *.elf *.s *.o *.map \ No newline at end of file + -rm -f *.elf *.s *.o diff --git a/src/main.o b/src/main.o index a1e35354b3bb9a576f984e954fef13f5a77ef7ff..5a9f227b9916dfedff9f54073ec4a82cd1f66939 100644 Binary files a/src/main.o and b/src/main.o differ diff --git a/src/main.s b/src/main.s index 6cff7294274d4091c2d21aa3ca5e8752719aa033..1db42fb1c7870171d8717debc0fb6dfd3ed97784 100644 --- a/src/main.s +++ b/src/main.s @@ -1,4 +1,16 @@ .file "main.c" + .text + .align 2 + .global kerent + .type kerent, %function +kerent: + @ args = 0, pretend = 0, frame = 0 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + ldmfd sp, {fp, sp, pc} + .size kerent, .-kerent .section .rodata .align 2 .LC0: @@ -9,4 +21,110 @@ .align 2 .LC2: .ascii "kerxit.c: Goodbye\012\015\000" + .text + .align 2 + .global kerxit + .type kerxit, %function +kerxit: + @ args = 0, pretend = 0, frame = 8 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {sl, fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #8 + ldr sl, .L6 +.L5: + add sl, pc, sl + str r0, [fp, #-20] + str r1, [fp, #-24] + mov r0, #1 + ldr r3, .L6+4 + add r3, sl, r3 + mov r1, r3 + bl bwprintf(PLT) + mov r0, #1 + ldr r3, .L6+8 + add r3, sl, r3 + mov r1, r3 + bl bwprintf(PLT) + bl kerent(PLT) + mov r0, #1 + ldr r3, .L6+12 + add r3, sl, r3 + mov r1, r3 + bl bwprintf(PLT) + sub sp, fp, #16 + ldmfd sp, {sl, fp, sp, pc} +.L7: + .align 2 +.L6: + .word _GLOBAL_OFFSET_TABLE_-(.L5+8) + .word .LC0(GOTOFF) + .word .LC1(GOTOFF) + .word .LC2(GOTOFF) + .size kerxit, .-kerxit + .align 2 + .global initialize + .type initialize, %function +initialize: + @ args = 0, pretend = 0, frame = 4 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #4 + str r0, [fp, #-16] + ldmfd sp, {r3, fp, sp, pc} + .size initialize, .-initialize + .align 2 + .global handle + .type handle, %function +handle: + @ args = 0, pretend = 0, frame = 8 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #8 + str r0, [fp, #-16] + str r1, [fp, #-20] + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size handle, .-handle + .align 2 + .global main + .type main, %function +main: + @ args = 0, pretend = 0, frame = 20 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #20 + str r0, [fp, #-28] + str r1, [fp, #-32] + ldr r0, [fp, #-24] + bl initialize(PLT) + mov r3, #0 + str r3, [fp, #-16] + b .L13 +.L14: + ldr r0, [fp, #-24] + ldr r1, [fp, #-20] + bl kerxit(PLT) + ldr r0, [fp, #-24] + ldr r1, [fp, #-20] + bl handle(PLT) + ldr r3, [fp, #-16] + add r3, r3, #1 + str r3, [fp, #-16] +.L13: + ldr r3, [fp, #-16] + cmp r3, #3 + ble .L14 + mov r3, #0 + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size main, .-main .ident "GCC: (GNU) 4.0.2"