{"id":23586514,"url":"https://github.com/doctorwkt/apout","last_synced_at":"2025-05-07T07:47:02.253Z","repository":{"id":45084086,"uuid":"72384404","full_name":"DoctorWkt/Apout","owner":"DoctorWkt","description":"A user-mode simulator for various version of PDP-11 Unix","archived":false,"fork":false,"pushed_at":"2016-10-31T04:29:07.000Z","size":143,"stargazers_count":30,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T07:51:12.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DoctorWkt.png","metadata":{"files":{"readme":"README","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-31T00:29:44.000Z","updated_at":"2025-03-05T16:26:41.000Z","dependencies_parsed_at":"2022-07-13T05:10:32.832Z","dependency_job_id":null,"html_url":"https://github.com/DoctorWkt/Apout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2FApout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2FApout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2FApout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2FApout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DoctorWkt","download_url":"https://codeload.github.com/DoctorWkt/Apout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252838877,"owners_count":21812082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-27T04:11:27.076Z","updated_at":"2025-05-07T07:47:02.229Z","avatar_url":"https://github.com/DoctorWkt.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\t       Apout -- Simulate PDP-11 Unix a.out binaries\n\t\t\t    Version 2.3 Beta 1\n\n\t\t     Warren Toomey  wkt@tuhs.org\n\t\t\t        June 2002\n\nIntroduction\n------------\nThis program is a user-level simulator for UNIX a.out binaries. Binaries\nfor V1, V2, V5, V6, V7, 2.9BSD and 2.11BSD can be run with this simulator.\nThe user-mode PDP-11 instructions are simulated, and TRAP instructions\nare emulated by calling equivalent native-mode system calls.\n\nThe advantages of an a.out simulator over a full-blown PDP-11 simulator are:\n\n   + system calls can be done natively, thus speeding up execution\n   + the simulator is less of a CPU-hog than a full-blown PDP-11 simulator\n   + you don't need a simulated operating system or a simulated file system\n\nApout can be obtained via anonymous ftp at minnie.tuhs.org in the\ndirectory pub/PDP-11/Sims/Apout. The directory pub/PDP-11/Sims/Apout/UnixBins\ncontains tar archives of a.out binaries from several versions of UNIX.\n\nStatus\n------\nThe program is now at release 2.3 Alpha2. Most of the binaries from V5, V6\nand V7 run fine. All of the V5/V6/V7 system calls are caught, but some are\nignored and some generate EPERM errors. The V1, V2, 2.9BSD and 2.11BSD\nenvironments are still under construction: see the file LIMITATIONS for\ndetails. Finally, the simulator won't run on a big-endian machine.\n\nINSTALLATION\n------------\nI have only tested this program on FreeBSD 2.x and 3.x, and on RedHat\nLinux 2.2. It should compile on a 32-bit little-endian machine with\nsome form of Unix; you may need to change some header file includes etc.\nSee `defines.h' for the details. In particular, if your system doesn't have\ntypes for:\n\n\tint8_t, int16_t, int32_t, u_int8_t, u_int16_t, u_int32_t\n\nor if your compiler doesn't have char=1 byte, short= 2 bytes, int=4 bytes,\nthen alter the relevant typedefs in `defines.h'.\n\nThe Makefile has two sets of CFLAGS/LDFLAGS: one set is for debugging, and\nthe other set is for speed. If you define the C pre-processor macro `DEBUG',\nthen this includes debugging code into the program. I use it quite heavily\nwhen trying to fix niggling problems.\n\nIf you remove the -DEMU211 macro definition from the Makefile, the emulation\nof 2.11BSD will not be compiled in to the simulator. Similarly, if you remove\nthe -DEMUV1 macro definition from the Makefile, the emulation of 1st and 2nd\nEdition UNIX will not be compiled in to the simulator. By default, EMUV1\nis disabled.\n\n\nOnce you have configured apout, now type `make'. Hopefully, things will\ncompile ok. You will eventually get the `apout' program.\n\nNow go find an old PDP-11 UNIX binary, e.g 7th Edition cal, and say:\n\n\t% setenv APOUT_ROOT /\t\t# for now\n\t% apout cal 1970\n\nIf the simulator is working, the calendar for 1970 will be printed out.\nThe V7 shell works, and from there, you can run other programs.\n\n\t% apout sh\n\t# ls -l\n\t    output of ls\n\t#\n\nFinally, install apout in /usr/local/bin, and the manual page apout.1 in\nthe appropriate place. If you can't use the man page because of incompatible\nmacros, then apout.0 is a text file which has the pre-formatted man page.\n\nDEBUG OPTIONS\n-------------\nWhen debugging is compiled in, the program has several options:\n\n\t-inst\tturns on instruction tracing, which is _very_ verbose\n\t-trap\tturns on TRAP tracing; not all syscalls have debugging code\n\t-jsr\tprints out the details of each jsr and rts\n\t-fp\tprints out some details of floating-point instructions\n\nAll debugging output goes out to the file `apout.dbg'. These debugging options\nare mainly used for testing apout, and so the output in apout.dbg may not be\nvery useful to you.\n\nENVIRONMENT VARIABLES\n---------------------\nApout has the concept of a simulated root filesystem for the simulated PDP-11\nbinaries. When working with filenames, if the filenames are relative, they\nstay relative. If the filenames are absolute (i.e /usr/...), then apout\nprepends the value of the environment variable APOUT_ROOT to the filename.\nThis allows you to say:\n\n\t# setenv APOUT_ROOT /usr/misc/v7root\n\nbefore running apout to set the `root' of the filesystem wherever you want.\nYou MUST set APOUT_ROOT before running apout.\n\nTODO\n----\nThere's lots to do. Here's what I'd like to do, in a somewhat ordered list.\n\n\t+ Verify that the instruction simulation and\thigh priority\n\t     the syscalls all work correctly\n\t+ Complete some of the syscalls that are\tmed priority\n\t     not fully simulated\n\t+ Speed the simulator up \t\t\tmed priority\n\nSOURCE ORGANISATION\n-------------------\n\nmain.c\t\tparses any arguments, loads the binary and calls run()\ncpu.c\t\tholds the main instruction decode/execute loop\nitab.c\t\tholds function lookup tables for all instructions\nea.c\t\tholds functions to decode the PDP-11 addressing modes\ndebug.c\t\tholds strings for all emulated opcodes\n\nsingle.c\tsingle.c, double.c and branch.c hold most of the functions\ndouble.c\t which perform the PDP-11 user-mode instructions. The code\nbranch.c\t in these files comes from a PDP-11 simulator by Eric Edwards\nfp.c\t\tpartially emulates FP instructions\n\naout.c\t\tdetermines what type of a.out the binary is, and what UNIX\nmagic.c\t\t environment to set up. If V5/V6/V7, trap instructions fall\nv7trap.c\t into v7trap.c which runs them using native system calls\nv7trap.h\n\nv1trap.c\tif the binary is a 1st or 2nd Edition binary, traps fall\nv1trap.h\t into v1trap.c, which likewise does the syscalls natively\nke11a.c\t\temulates the KE11A extended arithmetic unit, used by V1/V2\n\nbsdtrap.c\tif the binary is a 2.11BSD binary, trap instructions fall\nbsdtrap.h\t into bsdtrap.c, which likewise does the syscalls natively\nbsd_ioctl.c\t2.11BSD ioctl calls are handled with this file\n\ndefines.h\tholds function \u0026 typedef prototypes and useful cpp macros\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctorwkt%2Fapout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoctorwkt%2Fapout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctorwkt%2Fapout/lists"}