kos prints out the first 10 ints in the console buffer before it exits. a.out is currently the cpu binary so if you run kos < test you will see that its getting stored in the consBuf. The problem is that -1 is getting stored in consBuf first (at consBuf->buf[0]) so when you try to run the cat binary, it just reads the -1 and thinks it has reached EOF and exits.