The basic C library for user programs tries to read argv off the stack. ì¶ê° ì¤ëª ì íìë©´ stdinì ë«ì¼ë©´ íë¡ì¸ì¤ê° ì ë ¥ì ì½ì´ì ì ëê³ , stdoutì ë«ì¼ë©´ íë¡ì¸ì¤ê° ì¶ë ¥ëì§ ììì¼ íë¤. This will happen if you havent implemented argument passing (or havent done so correctly). Background Topics Parameter Passing System call infrastructure File manipulation Youjip Won Background Youjip Won To run a program Read the executable file from the disk. ê·¸ëì ì ì¸ ì¤ì ìì #ì ì§ìì¼ extraë¶ë¶ í ì¤í¸ë¥¼ í ì ìë¤. Pintos Project Operating Systems LabPart 2: User Programs YoujipWon Overview Objective Execute a user program in Pintos. GRADING_FILE = $(SRCDIR)/tests/userprog/Grading.extra # Uncomment the lines below to submit/test extra for project 2. The first word is the program name, the second word is the first. Implement this functionality, by extending processexecute() so that instead of simply taking a program file name as its argument, it divides it into words at spaces. Implement this functionality, by extending processexec() sothat instead of simply taking a program file name as its argument, it divides itinto words at spaces. Currently, processexecute() does not support passing arguments to new processes. GRADING_FILE = $(SRCDIR)/tests/userprog/Grading.no-extra Currently, processexec() does not support passing arguments to newprocesses. ![]() TEST_SUBDIRS = tests/userprog tests/filesys/base tests/userprog/no-vm tests/threads pintos -q run echo x The result is like below. Project 2: User Programs 3.1 Background 3.1.1 Source Files 3.1.2 Using the File System 3.1.3 How User Programs Work 3.1.4 Virtual Memory Layout 3.1.4.1 Typical Memory Layout 3.1.5 Accessing User Memory 3.2 Suggested Order of Implementation 3. After implementing argument passing, I enter below command. KERNEL_SUBDIRS += devices lib lib/kernel userprog filesys pintos userprogram-argument passing segmentation fault problem Im Working on Pintos Project 2 to prepare Operating System Course. KERNEL_SUBDIRS = threads tests/threads tests/threads/mlfqs PintOS | Project 2 | ìì¤í ì½ êµ¬í (fork, wait, read, write, seek, tell, close) ![]() Stack pointer should point this return address.IntOS | Project 2 | ìì¤í ì½ êµ¬í (halt, exit, exec, create, remove, open, filesize) When pushing arguments is done, load() should push return address where callee process returns. ![]() This should not violate calling convention, so they must push arguments right to left. This command creates a 2 MB simulated disk named fs.dsk. Adjust start_process() and load() to make them match function parameters with given arguments. From the userprog/build directory, execute pintos-mkdisk fs.dsk.1.1.1 Data structure No complex data structure, only use string s and int s 1.1.1 Functions is given in the pintos document, which is thread-safe and could save leftovers of parsing in given pointer, which would be arguments of a file. This could be done by importing some of string-related functions in string.h. That is, process_execute("A b c d e") should execute file named A with b, c, d, and e as its arguments. Until you have implemented syscalls sufficiently, you can use hexdump to check your argument passing. ![]() Since even basic operators such as + needs two or more arguments to carry out tasks, this completely limits the range of tasks pintos could handle, and forces every callee functions to independently get data without help of caller functions.Ĭhange prototype of process_execute(), to make it support passing of data given as its argument. The default syscall handler just handles exit(). That is, it just simply executes a file with a given name, giving nothing to file that is being executed. Implement argument passing to support passing arguments to threads.Ĭurrent process_execute() does not support arguments.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |