0

Im trying to follow this guide, the section about user programs. Apparently, Im able to succesfully pass a program from ubuntu to the Pintos filesystem, because I can see the file by running pintos -q ls

Output of pintos -q ls

When runnning this:

pintos-mkdisk filesys.dsk --filesys-size=2
pintos -f -q
pintos -p ../../examples/echo -a echo -- -q
pintos -q run 'echo x'

I only get this, and no printing:

Running the echo program inside pintos

Any idea of why not seeing the output? I've also tried with the "hellopintos" file, which is simply a hello world like this:

#include <stdio.h>
#include <syscall.h>

    void main(){
       printf("Hello pintos\n");

    }
  • the guide: https://web.stanford.edu/class/cs140/projects/pintos/pintos_3.html – Denys Arturo Rosario Coste Mar 06 '20 at 12:37
  • Description of the code you use: "Here's a summary of how to create a disk with a file system partition, format the file system, copy the `echo` program into the new disk, and then run `echo`, passing argument x." So this is a code for the `echo` command, not for your program. – Tsyvarev Mar 06 '20 at 13:25
  • The exact same thing happens when running my program with `pintos -q run 'hellopintos'` . After the creation. Anyways, shouldn't the echo program(which is under src/examples folder) give an output? – Denys Arturo Rosario Coste Mar 06 '20 at 15:07

1 Answers1

1

The issue was that the syscall handler was not implemented on userprog/syscall.c After implementing it and handling the write/print case, the issue was resolved.

  • Do you mind elaborating on how you fixed it? Even if printf syscall is not implemented shouldn't it have output "Syscall not implemented" instead of terminating blank? – Sarthak123 Mar 27 '21 at 12:04