├── bin ├── .keep ├── ppx.sh └── ocamlcflags ├── machine └── .keep ├── BOOTSTRAP └── .keep ├── kernel ├── init │ └── .keep ├── console │ └── .keep ├── devices │ └── .keep ├── files │ ├── sysopen.ml │ ├── sysseek.ml │ ├── sysclose.ml │ ├── syspread.ml │ ├── syspwrite.ml │ └── Chan.ml ├── interrupts │ └── .keep ├── ipc │ ├── sysnoted.ml │ ├── sysnotify.ml │ └── syspipe.ml ├── network │ └── .keep ├── filesystems │ └── .keep ├── namespaces │ ├── sysbind.ml │ ├── sysmount.ml │ └── sysumount.ml ├── time │ ├── Alarms_kproc.ml │ ├── Hz_alarms.ml │ ├── Timer_interrupt.mli │ ├── Hz_clock.mli │ ├── syssleep.mli │ ├── sysalarm.mli │ ├── Time_rendez.mli │ ├── Timer.mli │ ├── dune │ ├── Alarms.mli │ ├── Timers.mli │ └── mkfile ├── directories │ ├── syschdir.ml │ ├── syscreate.ml │ ├── sysfd2path.ml │ ├── sysfstat.ml │ ├── sysfwstat.ml │ └── sysremove.ml ├── concurrency │ ├── Tas.mli │ ├── Counter.mli │ ├── Ilock.mli │ ├── Spl.mli │ ├── Rwlock.mli │ ├── Qlock.mli │ ├── Spinlock.mli │ ├── Ref.mli │ ├── Counter.ml │ ├── dune │ ├── mkfile │ ├── Spl.ml │ └── Tas.ml ├── sysnop.mli ├── scheduler │ ├── Hz_sched.mli │ ├── Scheduler.mli │ ├── Rendez.mli │ ├── dune │ └── mkfile ├── memory │ ├── sysbrk.mli │ ├── Proc_segment.mli │ ├── Pagetable.mli │ ├── Kernel_memory.mli │ ├── Segment.mli │ ├── dune │ ├── mkfile │ ├── User_memory.mli │ └── Kernel_memory.ml ├── processes │ ├── sysawait.mli │ ├── Kproc.mli │ ├── sysexec.mli │ ├── sysrfork.mli │ ├── sysexits.mli │ ├── dune │ └── mkfile ├── Libc │ ├── arm │ │ ├── getcallerpc.s │ │ ├── vlop.s │ │ └── setjmp.s │ ├── port │ │ ├── atof.c │ │ ├── strlen.c │ │ ├── abs.c │ │ ├── fabs.c │ │ ├── strdup.c │ │ ├── toupper.c │ │ ├── memccpy.c │ │ ├── strchr.c │ │ ├── strncpy.c │ │ ├── utflen.c │ │ ├── strncmp.c │ │ ├── utfecpy.c │ │ └── memcmp.c │ └── fmt │ │ ├── errfmt.c │ │ ├── fprint.c │ │ ├── snprint.c │ │ ├── sprint.c │ │ ├── fmtprint.c │ │ └── vseprint.c ├── Syscall_dispatch.mli ├── sysnop.ml ├── core │ ├── Print.mli │ ├── mkfile │ ├── dune │ ├── Error.ml │ ├── Conf.ml │ └── Print.ml ├── Byterun │ ├── config │ │ └── m.h │ └── backtrace.h ├── Port │ ├── portdat_console.h │ ├── portfns_security.h │ ├── portfns_network.h │ ├── portfns_syscalls.h │ ├── portfns_interrupts.h │ ├── portfns_misc.h │ └── portfns_buses.h ├── concurrency_ │ ├── Spl_.ml │ ├── Ref_.ml │ ├── dune │ ├── mkfile │ ├── Qlock_.ml │ └── Rendez_.ml ├── Bcm │ ├── dat_forward.h │ ├── dat_arch.h │ ├── dat_time.h │ └── dat_memory.h ├── Libgeometry │ ├── misc.c │ └── fmt.c ├── Include │ └── cursor.h ├── arch │ └── arm.ml ├── base │ ├── dune │ └── mkfile ├── dune ├── Old │ ├── mkfile │ └── mem.h └── Libmemdraw │ └── hooks.c ├── lib_audio └── .keep ├── lib_gui ├── button.ml ├── label.ml ├── widget.ml ├── lib_graphics │ ├── draw │ │ ├── arc.ml │ │ ├── font.ml │ │ ├── text.ml │ │ ├── ellipse.ml │ │ ├── channel.ml │ │ ├── tests │ │ │ ├── hellodraw │ │ │ └── mkfile │ │ ├── line.ml │ │ ├── mkfile │ │ └── display.ml │ ├── input │ │ ├── keyboard.mli │ │ ├── keyboard.ml │ │ ├── mkfile │ │ ├── cursor.mli │ │ └── mouse.mli │ ├── geometry │ │ ├── vector.ml │ │ ├── mkfile │ │ └── point.mli │ ├── pad.txt │ └── mkfile ├── gui.ml ├── tests │ ├── hellogui.ml │ └── mkfile └── mkfile ├── networking └── .keep ├── profiler └── .keep ├── tests ├── mk │ ├── bar.c │ ├── foo.c │ ├── foo.h │ ├── foo.inc │ ├── mk-novar │ ├── mk-dyn │ ├── mk-infinite-simple │ ├── mk-dynamic-assign │ ├── mk-cycle │ ├── mk-scalar-context │ ├── mk-toplevel-backquote │ ├── mk-concat-vars │ ├── mk-empty-var │ ├── mk-ambiguous │ ├── dynrule.sh │ ├── mk-infinite │ ├── mk-backquote │ ├── mk-fail-early │ ├── mk-specialized-vs-meta │ ├── mk-too-many-spaces │ ├── todo │ │ └── mk-bad-space-after-antislash │ ├── mkfile │ ├── mk-ambiguous-simple │ ├── mk-vacuous │ ├── make-cycle │ └── mk-cycle-bis ├── macroprocessor │ ├── bar.h │ ├── foo.h │ ├── errors │ │ ├── ifdef_eof.c │ │ ├── location.c │ │ └── macro_unclosed.c │ ├── macro_varargs.c │ ├── todo │ │ └── include_absolute.c │ ├── macro_specialchar.c │ ├── ifdef.c │ ├── macro_noargs.c │ ├── macro.c │ ├── macro_args.c │ ├── macro_string.c │ └── macro_sharpsharp.c ├── vcs │ ├── hello.txt │ ├── blah.txt │ ├── file1 │ ├── file_a │ ├── file_b │ ├── file_origin │ ├── file2 │ └── 9f4d96d5b00d98959ea9960f069585ce42b1349a ├── compiler │ ├── parsing │ │ ├── todo │ │ │ ├── enum_float.c │ │ │ ├── struct_forward.c │ │ │ └── strings_unicode.c │ │ ├── longlong.c │ │ ├── number_long.c │ │ ├── globals.c │ │ ├── stricter │ │ │ ├── type_redundant.c │ │ │ ├── typedef_useless.c │ │ │ ├── extern.c │ │ │ └── function_typedef.c │ │ ├── errors │ │ │ ├── function.c │ │ │ ├── longlonglong.c │ │ │ ├── function_initializer.c │ │ │ ├── storage_illegal.c │ │ │ ├── 3dots.c │ │ │ ├── auto_global.c │ │ │ ├── param_function.c │ │ │ ├── typedef_and_init.c │ │ │ ├── typedef_and_function.c │ │ │ ├── cast_storage.c │ │ │ └── type_illegal.c │ │ ├── function_type.c │ │ ├── const.c │ │ ├── auto.c │ │ ├── function_pointer.c │ │ ├── mkfile │ │ ├── label.c │ │ ├── array_param.c │ │ ├── typedef.c │ │ ├── helloworld.c │ │ ├── for.c │ │ ├── array.c │ │ └── struct.c │ ├── lexing │ │ ├── escaped_slash.c │ │ └── escaped_newline.c │ ├── checking │ │ ├── param_storage.c │ │ ├── undeclared.c │ │ ├── label_undeclared.c │ │ ├── local_unused.c │ │ ├── ident.c │ │ ├── label_unused.c │ │ ├── enum_redeclare.c │ │ ├── function_shadow.c │ │ ├── if_empty.c │ │ ├── tag_inconsistent.c │ │ ├── struct_duplicate_fields.c │ │ ├── enum_redefined.c │ │ ├── function_implicit.c │ │ ├── label_redeclared.c │ │ ├── struct_undefined.c │ │ ├── static.c │ │ ├── struct_redeclare.c │ │ ├── function_redeclare.c │ │ ├── for_useless.c │ │ ├── tag_redeclared.c │ │ ├── field.c │ │ ├── typedef_redefined.c │ │ ├── global_redeclare.c │ │ ├── storage_adjust.c │ │ └── redeclaration.c │ ├── codegen │ │ ├── trivial.c │ │ ├── arithmetic.c │ │ ├── params.c │ │ ├── init.c │ │ ├── mkfile │ │ ├── array.c │ │ ├── assign.c │ │ ├── local.c │ │ ├── return.c │ │ ├── simple.c │ │ ├── function.c │ │ ├── enum.c │ │ ├── helloraw.c │ │ ├── dowhile.c │ │ ├── break.c │ │ ├── pointer.c │ │ ├── call.c │ │ ├── goto.c │ │ ├── while.c │ │ ├── address_local.c │ │ └── if.c │ ├── typing │ │ ├── lvalue.c │ │ ├── type_incompatible.c │ │ ├── typecheck.c │ │ ├── varargs.c │ │ ├── pointer_sub.c │ │ ├── and.c │ │ ├── array_typechecking.c │ │ ├── param_array.c │ │ ├── voidstar.c │ │ ├── switch.c │ │ ├── struct_compatibility.c │ │ └── pointer_minus.c │ ├── scoping │ │ ├── params_scope.c │ │ ├── param_shadow.c │ │ ├── enum_shadowing.c │ │ └── typedef_scope.c │ ├── extensions │ │ ├── unnamed_illegal.c │ │ ├── unnamed.c │ │ ├── unnamed_union.c │ │ └── unnamed_unsugar.c │ ├── start_arm.s │ └── xexit_arm.s ├── ed │ └── missing_newline_eof.txt ├── rc │ ├── skipnl.rc │ ├── hello.rc │ ├── stringify.rc │ ├── rcmain.rc │ ├── caret.rc │ ├── if.rc │ ├── todo │ │ └── here.rc │ ├── dup.rc │ ├── backquote.rc │ └── for.rc ├── linker │ ├── mkfile │ └── world.s ├── snapshots │ └── xix │ │ ├── 3b92cc34e275 │ │ └── name │ │ ├── 8a6f7985290d │ │ └── name │ │ ├── df6eb3b06e05 │ │ └── name │ │ ├── 323ff00ac45d │ │ ├── name │ │ └── stdxxx │ │ ├── 35d2cd07dafc │ │ └── name │ │ ├── 59feb8992231 │ │ └── name │ │ ├── 87b8de3216f3 │ │ └── name │ │ ├── 8e6f69c3135b │ │ └── name │ │ ├── bd8eca13fd2b │ │ └── name │ │ ├── dbae373ebb9e │ │ ├── name │ │ └── stdxxx │ │ ├── fea004a3a397 │ │ └── name │ │ ├── 11f8d5514a21 │ │ └── name │ │ ├── 2cfe73530a0b │ │ ├── name │ │ └── stdxxx │ │ ├── 2e288e6f7135 │ │ ├── name │ │ └── stdxxx │ │ ├── 374f7a6d8336 │ │ └── name │ │ ├── 53acad3d15cb │ │ ├── name │ │ └── stdxxx │ │ ├── 9a6a01b43a19 │ │ └── name │ │ ├── b6d7b725a36f │ │ └── name │ │ ├── b6fe43d7672d │ │ └── name │ │ ├── b7605d831321 │ │ └── name │ │ ├── bbf501cae659 │ │ └── name │ │ ├── c9f41592ee0d │ │ └── name │ │ ├── cf946fabcb27 │ │ └── name │ │ ├── d48112b4dfc3 │ │ └── name │ │ ├── d57c95967180 │ │ ├── name │ │ └── stdxxx │ │ ├── d95583667d6b │ │ └── name │ │ ├── e21e6e3afcfe │ │ ├── name │ │ └── stdxxx │ │ ├── f5624516e7b9 │ │ ├── name │ │ └── stdxxx │ │ ├── 04ed11ae91db │ │ └── name │ │ ├── 104f16da38c9 │ │ └── name │ │ ├── 311ce9a0eeeb │ │ └── name │ │ ├── 3ba0f42cc944 │ │ └── name │ │ ├── 4eac33d61e2d │ │ ├── name │ │ └── stdxxx │ │ ├── 84bbacde138f │ │ └── name │ │ ├── 92a9a80eb7c4 │ │ └── name │ │ ├── 950c2b43e47d │ │ ├── name │ │ └── stdxxx │ │ ├── 9a9f36d8103e │ │ ├── name │ │ └── stdxxx │ │ ├── a065f11c1073 │ │ └── name │ │ ├── aadc03502189 │ │ └── name │ │ ├── ab2d37806ee0 │ │ └── name │ │ ├── af57b840ca0e │ │ └── name │ │ ├── bafef64be874 │ │ └── name │ │ ├── c28b806da432 │ │ ├── name │ │ └── stdxxx │ │ ├── c51f151f9c74 │ │ └── name │ │ ├── c93eab6c9c10 │ │ └── name │ │ ├── d4f5f890c70a │ │ └── name │ │ ├── e38254f497ad │ │ ├── name │ │ └── stdxxx │ │ ├── ecf6e3880071 │ │ └── name │ │ ├── f092e735ec95 │ │ └── name │ │ ├── 35f100ebdd98 │ │ ├── name │ │ └── stdxxx │ │ └── 683a109b63ed │ │ ├── name │ │ └── stdxxx ├── assembler │ ├── mkfile │ ├── test.s │ ├── macro.s │ ├── quote.s │ ├── exit_linux_riscv.s │ ├── exit_linux_mips.s │ └── exit_linux_arm.s ├── lex │ └── lexer.mll └── yacc │ └── arith.mly ├── vcs ├── todo │ ├── hooks.ml │ ├── ignore.ml │ ├── pack.ml │ ├── rebase.ml │ ├── reflog.ml │ ├── server.ml │ ├── tag.ml │ ├── cmd_archive.ml │ ├── cmd_bisect.ml │ ├── cmd_blame.ml │ ├── cmd_grep.ml │ ├── cmd_rebase.ml │ ├── cmd_revert.ml │ ├── cmd_stash.ml │ ├── cmd_tag.ml │ ├── protocol.ml │ ├── config.ml │ └── cmd_mv.ml ├── docs │ └── latex ├── clients.mli ├── client_local.mli ├── diff_basic.mli ├── client_git.mli ├── diff_unified.mli ├── dump.mli ├── diffs.mli └── dune ├── lib_networking └── .keep ├── linker ├── Optimize5.ml ├── Optimizev.ml ├── tools │ ├── size.ml │ └── strip.ml ├── docs │ ├── latex │ ├── Intro.nw │ └── lineage.txt ├── Optimize.ml ├── executables │ ├── mkfile │ ├── dune │ └── A_out.mli ├── libraries │ ├── mkfile │ └── dune ├── Flags.ml ├── Rewritev.mli ├── Check.mli ├── TOPORT │ └── ld │ │ └── elf.h ├── Datagen.mli ├── Codegenv.mli ├── Execgen.mli ├── Layout.mli ├── Rewrite5.mli ├── Resolve.mli ├── Layoutv.mli └── Typesv.ml ├── macroprocessor ├── CLI.mli ├── Main.ml ├── CLI.ml └── mkfile ├── test ├── browser └── fork-mmm.submodule ├── compiler ├── TODO │ ├── Debugger.mli │ ├── Profiler.mli │ ├── Debugger.ml │ └── Profiler.ml ├── docs │ ├── latex │ ├── Intro.nw │ └── lineage.txt ├── Archi.mli ├── Archv.mli ├── TOPORT │ ├── cc │ │ └── omachcap.c │ └── ic │ │ └── machcap.c ├── Arch5.mli ├── tests │ └── dune ├── Rewrite.mli ├── Error.mli ├── Dumper_.mli ├── Globals.ml ├── Parse.mli └── Meta_storage.ml ├── editor └── fork-efuns.submodule ├── lib_core ├── symlinks │ ├── lexing │ ├── parsing │ ├── fun.ml │ ├── gc.ml │ ├── gc.mli │ ├── int.ml │ ├── obj.ml │ ├── arg.ml │ ├── arg.mli │ ├── bool.ml │ ├── bool.mli │ ├── bytes.ml │ ├── char.ml │ ├── char.mli │ ├── float.ml │ ├── fun.mli │ ├── int.mli │ ├── lazy.ml │ ├── lazy.mli │ ├── obj.mli │ ├── sys.ml │ ├── sys.mli │ ├── uchar.ml │ ├── buffer.ml │ ├── buffer.mli │ ├── callback.ml │ ├── digest.ml │ ├── digest.mli │ ├── either.ml │ ├── either.mli │ ├── float.mli │ ├── format.ml │ ├── list.ml │ ├── map.ml │ ├── map.mli │ ├── marshal.ml │ ├── marshal.mli │ ├── option.ml │ ├── option.mli │ ├── pervasives.ml │ ├── printf.ml │ ├── random.ml │ ├── random.mli │ ├── result.ml │ ├── result.mli │ ├── set.ml │ ├── set.mli │ ├── std_exit.ml │ ├── string.ml │ ├── string.mli │ ├── uchar.mli │ ├── array.ml │ ├── array.mli │ ├── callback.mli │ ├── filename.ml │ ├── filename.mli │ ├── format.mli │ ├── hashtbl.ml │ ├── list.mli │ ├── pervasives.mli │ ├── printexc.ml │ ├── printf.mli │ ├── queue.ml │ ├── queue.mli │ ├── stack.ml │ ├── stack.mli │ ├── hashtbl.mli │ └── printexc.mli ├── profiling │ ├── ppx │ │ ├── tests │ │ │ ├── basic.ml │ │ │ ├── label.ml │ │ │ └── optional_param.ml │ │ └── dune │ └── dune ├── base │ └── Buffer.ml ├── commons │ ├── Date.mli │ ├── UChan.mli │ ├── Bits.mli │ ├── UConsole.ml │ ├── Ord.mli │ ├── Logs_.mli │ ├── Tmp.mli │ ├── UConsole.mli │ ├── CapStdlib.ml │ ├── OS.ml │ ├── Fpath_.mli │ ├── FS.mli │ ├── Ord.ml │ └── Fpath.mli ├── compression │ ├── zip.mli │ ├── dune │ └── compression.mli ├── crypto │ └── dune ├── parsing │ └── mkfile ├── system │ ├── mkfile │ ├── plan9 │ │ ├── mkfile │ │ ├── dune │ │ ├── plan9support.h │ │ ├── errstr.c │ │ ├── bind.c │ │ └── mount.c │ └── unix │ │ └── mkfile ├── printing │ └── mkfile ├── collections │ └── mkfile ├── regexps │ ├── re │ │ ├── dune │ │ └── tests │ │ │ └── dune │ └── str │ │ └── mkfile └── misc │ └── mkfile ├── lib_graphics ├── draw │ ├── Arc.ml │ ├── Arc.mli │ ├── Ellipse.ml │ ├── Ellipse.mli │ ├── Polygon.mli │ ├── Font_default.mli │ ├── Draw_ipc.mli │ ├── Text.mli │ ├── Draw_rio.mli │ ├── Layer.mli │ ├── dune │ ├── Line.mli │ ├── Draw_marshal.mli │ ├── Baselayer.mli │ ├── tests │ │ └── dune │ ├── Draw.mli │ ├── mkfile │ └── Subfont.mli ├── memdraw │ └── .keep ├── memlayer │ └── .keep ├── ui │ ├── Frame_ui.ml │ ├── Text_ui.ml │ ├── Selection_ui.ml │ ├── mkfile │ ├── dune │ └── Menu_ui.mli ├── geometry │ ├── Vector.mli │ ├── mkfile │ ├── dune │ └── Point.mli ├── input │ ├── dune │ ├── Cursor.mli │ ├── mkfile │ ├── tests │ │ └── mkfile │ └── Keyboard.mli └── mkfile ├── utilities ├── files │ ├── TODO │ │ ├── cp.ml │ │ ├── du.ml │ │ ├── ls.ml │ │ ├── mv.ml │ │ ├── rm.ml │ │ ├── chgrp.ml │ │ ├── chmod.ml │ │ ├── mkdir.ml │ │ ├── mtime.ml │ │ └── touch.ml │ ├── pwd.ml │ └── mkfile └── text │ └── ed │ ├── Main.ml │ ├── Token.ml │ ├── dune │ └── Error.ml ├── docs └── latex ├── languages ├── fork-tiger.submodule └── ocaml-light.submodule ├── principia ├── bin_dune ├── games └── ocaml-elm-playground.submodule ├── generators ├── dune ├── docs │ └── latex ├── yacc │ ├── Lalr.ml │ ├── Lalr.mli │ ├── CLI.mli │ ├── pad.txt │ ├── Slr.mli │ ├── Output.mli │ ├── Main.ml │ └── Check.mli └── lex │ ├── CLI.mli │ ├── Main.ml │ └── pad.txt ├── shell ├── docs │ ├── latex │ ├── Intro.nw │ ├── lineage.txt │ └── lineage.pdf ├── Glob.mli ├── Glob.ml ├── Heredoc.mli ├── Heredoc.ml ├── Env.mli ├── Fn.mli ├── Parse.mli ├── Compile.mli ├── tests │ └── dune ├── Fn.ml ├── Lexer.mli ├── Pattern.mli ├── Pattern.ml ├── Error.mli ├── Builtin.mli ├── Interpreter.mli └── Prompt.mli ├── assembler ├── docs │ ├── latex │ ├── Intro.nw │ └── lineage.txt ├── TOPORT │ ├── ia │ │ └── a.h │ ├── 7a │ │ └── a.h │ ├── 6a │ │ └── a.h │ └── 8a │ │ └── a.h ├── objects │ ├── dune │ └── mkfile ├── Parse_asmi.mli ├── Check_asm5.ml └── Parse_asm5.mli ├── windows ├── docs │ ├── latex │ ├── pics │ ├── Intro.nw │ └── lineage.txt ├── Dev_graphical_window.ml ├── Dev_graphical_window.mli ├── Dev_wm.mli ├── Dev_textual_window.mli ├── Virtual_draw.mli ├── Thread_keyboard.mli ├── Virtual_mouse.mli ├── Threads_fileserver.mli ├── Threads_window.mli ├── tests │ ├── dune │ └── test_rio_console_app1.ml ├── Virtual_cons.mli ├── Processes_winshell.mli ├── Dev_wm.ml └── Mouse_action.mli ├── .dockerignore ├── env.sh ├── scripts ├── skeleton_latex.rc └── remove_xix_open.sh ├── readme.txt ├── mkfiles ├── mkconfig.basic └── mkconfig.plan9 ├── dune-project ├── debugger └── mkfile ├── regressions.txt ├── lib_parsing └── mkfile └── install.txt /bin/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /machine/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BOOTSTRAP/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/init/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_audio/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_gui/button.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_gui/label.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_gui/widget.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /networking/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /profiler/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mk/bar.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mk/foo.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mk/foo.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mk/foo.inc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/hooks.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/ignore.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/pack.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/rebase.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/reflog.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/server.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/tag.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/console/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/devices/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/files/sysopen.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/files/sysseek.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/interrupts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/ipc/sysnoted.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/ipc/sysnotify.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/ipc/syspipe.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/network/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_networking/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linker/Optimize5.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linker/Optimizev.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linker/tools/size.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linker/tools/strip.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /macroprocessor/CLI.mli: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /macroprocessor/Main.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | bin_dune/test.bc -------------------------------------------------------------------------------- /vcs/todo/cmd_archive.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/cmd_bisect.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/cmd_blame.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/cmd_grep.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/cmd_rebase.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/cmd_revert.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/cmd_stash.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/cmd_tag.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/todo/protocol.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /browser/fork-mmm.submodule: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compiler/TODO/Debugger.mli: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compiler/TODO/Profiler.mli: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /editor/fork-efuns.submodule: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/files/sysclose.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/files/syspread.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/files/syspwrite.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/filesystems/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/namespaces/sysbind.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/time/Alarms_kproc.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/time/Hz_alarms.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_core/symlinks/lexing: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_core/symlinks/parsing: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/draw/Arc.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/draw/Arc.mli: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/draw/Ellipse.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/memdraw/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/memlayer/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/ui/Frame_ui.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/macroprocessor/bar.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/cp.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/du.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/ls.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/mv.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/rm.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/latex: -------------------------------------------------------------------------------- 1 | ../principia/docs/latex -------------------------------------------------------------------------------- /kernel/directories/syschdir.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/directories/syscreate.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/directories/sysfd2path.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/directories/sysfstat.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/directories/sysfwstat.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/directories/sysremove.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/namespaces/sysmount.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/namespaces/sysumount.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/time/Timer_interrupt.mli: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /languages/fork-tiger.submodule: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /languages/ocaml-light.submodule: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/draw/Ellipse.mli: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_graphics/ui/Text_ui.ml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/arc.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/font.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/text.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /principia: -------------------------------------------------------------------------------- 1 | ../principia-softwarica -------------------------------------------------------------------------------- /tests/macroprocessor/foo.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/mk/mk-novar: -------------------------------------------------------------------------------- 1 | A=1 2 | =2 3 | -------------------------------------------------------------------------------- /tests/vcs/hello.txt: -------------------------------------------------------------------------------- 1 | Hello Git 2 | -------------------------------------------------------------------------------- /utilities/files/TODO/chgrp.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/chmod.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/mkdir.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/mtime.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/files/TODO/touch.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin_dune: -------------------------------------------------------------------------------- 1 | _build/install/default/bin -------------------------------------------------------------------------------- /games/ocaml-elm-playground.submodule: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib_core/symlinks/fun.ml: -------------------------------------------------------------------------------- 1 | ../base/Fun.ml -------------------------------------------------------------------------------- /lib_core/symlinks/gc.ml: -------------------------------------------------------------------------------- 1 | ../core/Gc.ml -------------------------------------------------------------------------------- /lib_core/symlinks/gc.mli: -------------------------------------------------------------------------------- 1 | ../core/Gc.mli -------------------------------------------------------------------------------- /lib_core/symlinks/int.ml: -------------------------------------------------------------------------------- 1 | ../base/Int.ml -------------------------------------------------------------------------------- /lib_core/symlinks/obj.ml: -------------------------------------------------------------------------------- 1 | ../core/Obj.ml -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/ellipse.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mk/mk-dyn: -------------------------------------------------------------------------------- 1 | <| ./dynrule.sh 2 | -------------------------------------------------------------------------------- /generators/dune: -------------------------------------------------------------------------------- 1 | (dirs :standard \ docs) 2 | -------------------------------------------------------------------------------- /lib_core/symlinks/arg.ml: -------------------------------------------------------------------------------- 1 | ../system/Arg.ml -------------------------------------------------------------------------------- /lib_core/symlinks/arg.mli: -------------------------------------------------------------------------------- 1 | ../system/Arg.mli -------------------------------------------------------------------------------- /lib_core/symlinks/bool.ml: -------------------------------------------------------------------------------- 1 | ../base/Bool.ml -------------------------------------------------------------------------------- /lib_core/symlinks/bool.mli: -------------------------------------------------------------------------------- 1 | ../base/Bool.mli -------------------------------------------------------------------------------- /lib_core/symlinks/bytes.ml: -------------------------------------------------------------------------------- 1 | ../base/Bytes.ml -------------------------------------------------------------------------------- /lib_core/symlinks/char.ml: -------------------------------------------------------------------------------- 1 | ../base/Char.ml -------------------------------------------------------------------------------- /lib_core/symlinks/char.mli: -------------------------------------------------------------------------------- 1 | ../base/Char.mli -------------------------------------------------------------------------------- /lib_core/symlinks/float.ml: -------------------------------------------------------------------------------- 1 | ../base/Float.ml -------------------------------------------------------------------------------- /lib_core/symlinks/fun.mli: -------------------------------------------------------------------------------- 1 | ../base/Fun.mli -------------------------------------------------------------------------------- /lib_core/symlinks/int.mli: -------------------------------------------------------------------------------- 1 | ../base/Int.mli -------------------------------------------------------------------------------- /lib_core/symlinks/lazy.ml: -------------------------------------------------------------------------------- 1 | ../base/Lazy.ml -------------------------------------------------------------------------------- /lib_core/symlinks/lazy.mli: -------------------------------------------------------------------------------- 1 | ../base/Lazy.mli -------------------------------------------------------------------------------- /lib_core/symlinks/obj.mli: -------------------------------------------------------------------------------- 1 | ../core/Obj.mli -------------------------------------------------------------------------------- /lib_core/symlinks/sys.ml: -------------------------------------------------------------------------------- 1 | ../system/Sys.ml -------------------------------------------------------------------------------- /lib_core/symlinks/sys.mli: -------------------------------------------------------------------------------- 1 | ../system/Sys.mli -------------------------------------------------------------------------------- /lib_core/symlinks/uchar.ml: -------------------------------------------------------------------------------- 1 | ../base/Uchar.ml -------------------------------------------------------------------------------- /shell/docs/latex: -------------------------------------------------------------------------------- 1 | ../../principia/docs/latex -------------------------------------------------------------------------------- /tests/compiler/parsing/todo/enum_float.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vcs/docs/latex: -------------------------------------------------------------------------------- 1 | ../../principia/docs/latex -------------------------------------------------------------------------------- /assembler/docs/latex: -------------------------------------------------------------------------------- 1 | ../../principia/docs/latex -------------------------------------------------------------------------------- /compiler/docs/latex: -------------------------------------------------------------------------------- 1 | ../../principia/docs/latex/ -------------------------------------------------------------------------------- /generators/docs/latex: -------------------------------------------------------------------------------- 1 | ../../principia/docs/latex -------------------------------------------------------------------------------- /lib_core/symlinks/buffer.ml: -------------------------------------------------------------------------------- 1 | ../base/Buffer.ml -------------------------------------------------------------------------------- /lib_core/symlinks/buffer.mli: -------------------------------------------------------------------------------- 1 | ../base/Buffer.mli -------------------------------------------------------------------------------- /lib_core/symlinks/callback.ml: -------------------------------------------------------------------------------- 1 | ../core/Callback.ml -------------------------------------------------------------------------------- /lib_core/symlinks/digest.ml: -------------------------------------------------------------------------------- 1 | ../base/Digest.ml -------------------------------------------------------------------------------- /lib_core/symlinks/digest.mli: -------------------------------------------------------------------------------- 1 | ../base/Digest.mli -------------------------------------------------------------------------------- /lib_core/symlinks/either.ml: -------------------------------------------------------------------------------- 1 | ../base/Either.ml -------------------------------------------------------------------------------- /lib_core/symlinks/either.mli: -------------------------------------------------------------------------------- 1 | ../base/Either.mli -------------------------------------------------------------------------------- /lib_core/symlinks/float.mli: -------------------------------------------------------------------------------- 1 | ../base/Float.mli -------------------------------------------------------------------------------- /lib_core/symlinks/format.ml: -------------------------------------------------------------------------------- 1 | ../printing/Format.ml -------------------------------------------------------------------------------- /lib_core/symlinks/list.ml: -------------------------------------------------------------------------------- 1 | ../collections/List.ml -------------------------------------------------------------------------------- /lib_core/symlinks/map.ml: -------------------------------------------------------------------------------- 1 | ../collections/Map.ml -------------------------------------------------------------------------------- /lib_core/symlinks/map.mli: -------------------------------------------------------------------------------- 1 | ../collections/Map.mli -------------------------------------------------------------------------------- /lib_core/symlinks/marshal.ml: -------------------------------------------------------------------------------- 1 | ../core/Marshal.ml -------------------------------------------------------------------------------- /lib_core/symlinks/marshal.mli: -------------------------------------------------------------------------------- 1 | ../core/Marshal.mli -------------------------------------------------------------------------------- /lib_core/symlinks/option.ml: -------------------------------------------------------------------------------- 1 | ../base/Option.ml -------------------------------------------------------------------------------- /lib_core/symlinks/option.mli: -------------------------------------------------------------------------------- 1 | ../base/Option.mli -------------------------------------------------------------------------------- /lib_core/symlinks/pervasives.ml: -------------------------------------------------------------------------------- 1 | ../core/Stdlib.ml -------------------------------------------------------------------------------- /lib_core/symlinks/printf.ml: -------------------------------------------------------------------------------- 1 | ../printing/Printf.ml -------------------------------------------------------------------------------- /lib_core/symlinks/random.ml: -------------------------------------------------------------------------------- 1 | ../base/Random.ml -------------------------------------------------------------------------------- /lib_core/symlinks/random.mli: -------------------------------------------------------------------------------- 1 | ../base/Random.mli -------------------------------------------------------------------------------- /lib_core/symlinks/result.ml: -------------------------------------------------------------------------------- 1 | ../base/Result.ml -------------------------------------------------------------------------------- /lib_core/symlinks/result.mli: -------------------------------------------------------------------------------- 1 | ../base/Result.mli -------------------------------------------------------------------------------- /lib_core/symlinks/set.ml: -------------------------------------------------------------------------------- 1 | ../collections/Set.ml -------------------------------------------------------------------------------- /lib_core/symlinks/set.mli: -------------------------------------------------------------------------------- 1 | ../collections/Set.mli -------------------------------------------------------------------------------- /lib_core/symlinks/std_exit.ml: -------------------------------------------------------------------------------- 1 | ../core/std_exit.ml -------------------------------------------------------------------------------- /lib_core/symlinks/string.ml: -------------------------------------------------------------------------------- 1 | ../base/String.ml -------------------------------------------------------------------------------- /lib_core/symlinks/string.mli: -------------------------------------------------------------------------------- 1 | ../base/String.mli -------------------------------------------------------------------------------- /lib_core/symlinks/uchar.mli: -------------------------------------------------------------------------------- 1 | ../base/Uchar.mli -------------------------------------------------------------------------------- /linker/docs/latex: -------------------------------------------------------------------------------- 1 | ../../principia/docs/latex/ -------------------------------------------------------------------------------- /tests/ed/missing_newline_eof.txt: -------------------------------------------------------------------------------- 1 | this is cool -------------------------------------------------------------------------------- /tests/vcs/blah.txt: -------------------------------------------------------------------------------- 1 | Blah blah blah blah blah! 2 | -------------------------------------------------------------------------------- /windows/docs/latex: -------------------------------------------------------------------------------- 1 | ../../principia/docs/latex/ -------------------------------------------------------------------------------- /windows/docs/pics: -------------------------------------------------------------------------------- 1 | ../../principia/windows/pics -------------------------------------------------------------------------------- /kernel/files/Chan.ml: -------------------------------------------------------------------------------- 1 | (* less eqqid? eqchan? *) 2 | -------------------------------------------------------------------------------- /lib_core/symlinks/array.ml: -------------------------------------------------------------------------------- 1 | ../collections/Array.ml -------------------------------------------------------------------------------- /lib_core/symlinks/array.mli: -------------------------------------------------------------------------------- 1 | ../collections/Array.mli -------------------------------------------------------------------------------- /lib_core/symlinks/callback.mli: -------------------------------------------------------------------------------- 1 | ../core/Callback.mli -------------------------------------------------------------------------------- /lib_core/symlinks/filename.ml: -------------------------------------------------------------------------------- 1 | ../system/Filename.ml -------------------------------------------------------------------------------- /lib_core/symlinks/filename.mli: -------------------------------------------------------------------------------- 1 | ../system/Filename.mli -------------------------------------------------------------------------------- /lib_core/symlinks/format.mli: -------------------------------------------------------------------------------- 1 | ../printing/Format.mli -------------------------------------------------------------------------------- /lib_core/symlinks/hashtbl.ml: -------------------------------------------------------------------------------- 1 | ../collections/Hashtbl.ml -------------------------------------------------------------------------------- /lib_core/symlinks/list.mli: -------------------------------------------------------------------------------- 1 | ../collections/List.mli -------------------------------------------------------------------------------- /lib_core/symlinks/pervasives.mli: -------------------------------------------------------------------------------- 1 | ../core/Stdlib.mli -------------------------------------------------------------------------------- /lib_core/symlinks/printexc.ml: -------------------------------------------------------------------------------- 1 | ../printing/Printexc.ml -------------------------------------------------------------------------------- /lib_core/symlinks/printf.mli: -------------------------------------------------------------------------------- 1 | ../printing/Printf.mli -------------------------------------------------------------------------------- /lib_core/symlinks/queue.ml: -------------------------------------------------------------------------------- 1 | ../collections/Queue.ml -------------------------------------------------------------------------------- /lib_core/symlinks/queue.mli: -------------------------------------------------------------------------------- 1 | ../collections/Queue.mli -------------------------------------------------------------------------------- /lib_core/symlinks/stack.ml: -------------------------------------------------------------------------------- 1 | ../collections/Stack.ml -------------------------------------------------------------------------------- /lib_core/symlinks/stack.mli: -------------------------------------------------------------------------------- 1 | ../collections/Stack.mli -------------------------------------------------------------------------------- /lib_gui/gui.ml: -------------------------------------------------------------------------------- 1 | 2 | let init () = 3 | () 4 | 5 | -------------------------------------------------------------------------------- /linker/docs/Intro.nw: -------------------------------------------------------------------------------- 1 | ../../principia/linkers/Intro.nw -------------------------------------------------------------------------------- /shell/docs/Intro.nw: -------------------------------------------------------------------------------- 1 | ../../principia/shells/Intro.nw -------------------------------------------------------------------------------- /tests/compiler/parsing/longlong.c: -------------------------------------------------------------------------------- 1 | long long foo; 2 | -------------------------------------------------------------------------------- /tests/compiler/parsing/number_long.c: -------------------------------------------------------------------------------- 1 | int x = 0L; 2 | -------------------------------------------------------------------------------- /tests/rc/skipnl.rc: -------------------------------------------------------------------------------- 1 | 2 | ls | 3 | wc -l 4 | 5 | -------------------------------------------------------------------------------- /tests/vcs/file1: -------------------------------------------------------------------------------- 1 | a 2 | b 3 | c 4 | d 5 | e 6 | f 7 | -------------------------------------------------------------------------------- /tests/vcs/file_a: -------------------------------------------------------------------------------- 1 | 0 2 | 6 3 | 7 4 | 1 5 | 2 6 | 5 7 | -------------------------------------------------------------------------------- /windows/docs/Intro.nw: -------------------------------------------------------------------------------- 1 | ../../principia/windows/Intro.nw -------------------------------------------------------------------------------- /assembler/docs/Intro.nw: -------------------------------------------------------------------------------- 1 | ../../principia/assemblers/Intro.nw -------------------------------------------------------------------------------- /compiler/docs/Intro.nw: -------------------------------------------------------------------------------- 1 | ../../principia/compilers/Intro.nw -------------------------------------------------------------------------------- /kernel/concurrency/Tas.mli: -------------------------------------------------------------------------------- 1 | val tas: bool ref -> bool 2 | -------------------------------------------------------------------------------- /kernel/sysnop.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_nop: unit -> unit 3 | -------------------------------------------------------------------------------- /lib_core/symlinks/hashtbl.mli: -------------------------------------------------------------------------------- 1 | ../collections/Hashtbl.mli -------------------------------------------------------------------------------- /lib_core/symlinks/printexc.mli: -------------------------------------------------------------------------------- 1 | ../printing/Printexc.mli -------------------------------------------------------------------------------- /linker/docs/lineage.txt: -------------------------------------------------------------------------------- 1 | ../../principia/linkers/lineage.txt -------------------------------------------------------------------------------- /shell/Glob.mli: -------------------------------------------------------------------------------- 1 | (*s: Glob.mli *) 2 | (*e: Glob.mli *) 3 | -------------------------------------------------------------------------------- /shell/docs/lineage.txt: -------------------------------------------------------------------------------- 1 | ../../principia/shells/lineage.txt -------------------------------------------------------------------------------- /tests/compiler/lexing/escaped_slash.c: -------------------------------------------------------------------------------- 1 | char c = '\\'; 2 | -------------------------------------------------------------------------------- /tests/compiler/parsing/globals.c: -------------------------------------------------------------------------------- 1 | int y; 2 | int x = 1; 3 | -------------------------------------------------------------------------------- /tests/rc/hello.rc: -------------------------------------------------------------------------------- 1 | #!/bin/rc 2 | 3 | echo hello world 4 | -------------------------------------------------------------------------------- /tests/rc/stringify.rc: -------------------------------------------------------------------------------- 1 | A=a b c d 2 | B=$"A 3 | echo $B 4 | -------------------------------------------------------------------------------- /tests/vcs/file_b: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 3 4 | 4 5 | 2 6 | 5 7 | 9 8 | -------------------------------------------------------------------------------- /tests/vcs/file_origin: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | -------------------------------------------------------------------------------- /compiler/docs/lineage.txt: -------------------------------------------------------------------------------- 1 | ../../principia/compilers/lineage.txt -------------------------------------------------------------------------------- /tests/compiler/parsing/stricter/type_redundant.c: -------------------------------------------------------------------------------- 1 | int int x; 2 | -------------------------------------------------------------------------------- /tests/linker/mkfile: -------------------------------------------------------------------------------- 1 | clean nuke:V: 2 | rm -f *.5 *.out 3 | 4 | -------------------------------------------------------------------------------- /tests/snapshots/xix/3b92cc34e275/name: -------------------------------------------------------------------------------- 1 | mk > e2e > --help 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/8a6f7985290d/name: -------------------------------------------------------------------------------- 1 | shell > e2e > --help 2 | -------------------------------------------------------------------------------- /vcs/todo/config.ml: -------------------------------------------------------------------------------- 1 | (* .git/config, but also ~/.gitconfig *) 2 | -------------------------------------------------------------------------------- /windows/docs/lineage.txt: -------------------------------------------------------------------------------- 1 | ../../principia/windows/lineage.txt -------------------------------------------------------------------------------- /assembler/docs/lineage.txt: -------------------------------------------------------------------------------- 1 | ../../principia/assemblers/lineage.txt -------------------------------------------------------------------------------- /compiler/Archi.mli: -------------------------------------------------------------------------------- 1 | 2 | val arch: Ast_asmi.instr Arch_compiler.t 3 | -------------------------------------------------------------------------------- /compiler/Archv.mli: -------------------------------------------------------------------------------- 1 | 2 | val arch: Ast_asmv.instr Arch_compiler.t 3 | -------------------------------------------------------------------------------- /kernel/scheduler/Hz_sched.mli: -------------------------------------------------------------------------------- 1 | 2 | val hz_sched: unit -> unit 3 | -------------------------------------------------------------------------------- /kernel/time/Hz_clock.mli: -------------------------------------------------------------------------------- 1 | 2 | val hz_clock : unit -> unit 3 | 4 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/input/keyboard.mli: -------------------------------------------------------------------------------- 1 | 2 | type key = Rune.t 3 | -------------------------------------------------------------------------------- /shell/Glob.ml: -------------------------------------------------------------------------------- 1 | (*s: shell/Glob.ml *) 2 | (*e: shell/Glob.ml *) 3 | -------------------------------------------------------------------------------- /shell/Heredoc.mli: -------------------------------------------------------------------------------- 1 | (*s: Heredoc.mli *) 2 | (*e: Heredoc.mli *) 3 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/function.c: -------------------------------------------------------------------------------- 1 | void foo 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/longlonglong.c: -------------------------------------------------------------------------------- 1 | long long long foo; 2 | -------------------------------------------------------------------------------- /tests/compiler/parsing/function_type.c: -------------------------------------------------------------------------------- 1 | 2 | int* foo(int x); 3 | -------------------------------------------------------------------------------- /tests/macroprocessor/errors/ifdef_eof.c: -------------------------------------------------------------------------------- 1 | #ifdef FOO 2 | int x; 3 | -------------------------------------------------------------------------------- /tests/mk/mk-infinite-simple: -------------------------------------------------------------------------------- 1 | 2 | foo: foo 3 | 5l -c foo.c 4 | -------------------------------------------------------------------------------- /tests/snapshots/xix/df6eb3b06e05/name: -------------------------------------------------------------------------------- 1 | compiler > e2e > --help 2 | -------------------------------------------------------------------------------- /vcs/todo/cmd_mv.ml: -------------------------------------------------------------------------------- 1 | (* should handle moving directories too! *) 2 | -------------------------------------------------------------------------------- /generators/yacc/Lalr.ml: -------------------------------------------------------------------------------- 1 | (*s: yacc/Lalr.ml *) 2 | (*e: yacc/Lalr.ml *) 3 | -------------------------------------------------------------------------------- /kernel/time/syssleep.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_sleep: Types.t_ms -> unit 3 | -------------------------------------------------------------------------------- /tests/assembler/mkfile: -------------------------------------------------------------------------------- 1 | clean nuke:V: 2 | rm -f *.[v5] *.o[v5] *.out 3 | -------------------------------------------------------------------------------- /tests/compiler/checking/param_storage.c: -------------------------------------------------------------------------------- 1 | void foo(auto int x) { 2 | } 3 | -------------------------------------------------------------------------------- /tests/compiler/codegen/trivial.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | return 42; 3 | } 4 | -------------------------------------------------------------------------------- /tests/compiler/parsing/const.c: -------------------------------------------------------------------------------- 1 | extern int atoi(const char *); 2 | 3 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/function_initializer.c: -------------------------------------------------------------------------------- 1 | void foo() = 0; 2 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/storage_illegal.c: -------------------------------------------------------------------------------- 1 | extern static int x; 2 | -------------------------------------------------------------------------------- /tests/compiler/typing/lvalue.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | 3 | 1 = 2; 4 | } 5 | -------------------------------------------------------------------------------- /tests/mk/mk-dynamic-assign: -------------------------------------------------------------------------------- 1 | A=B 2 | $A=42 3 | 4 | all:Q: 5 | echo $B 6 | -------------------------------------------------------------------------------- /generators/yacc/Lalr.mli: -------------------------------------------------------------------------------- 1 | (*s: yacc/Lalr.mli *) 2 | (*e: yacc/Lalr.mli *) 3 | -------------------------------------------------------------------------------- /kernel/memory/sysbrk.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_brk: Types.user_addr -> unit 3 | -------------------------------------------------------------------------------- /lib_core/profiling/ppx/tests/basic.ml: -------------------------------------------------------------------------------- 1 | let foo a b = a + b [@@profiling] 2 | -------------------------------------------------------------------------------- /lib_core/profiling/ppx/tests/label.ml: -------------------------------------------------------------------------------- 1 | let foo ~a b = a + b [@@profiling] 2 | -------------------------------------------------------------------------------- /lib_graphics/ui/Selection_ui.ml: -------------------------------------------------------------------------------- 1 | (* old: called getrect.c in draw-C 2 | *) 3 | -------------------------------------------------------------------------------- /shell/Heredoc.ml: -------------------------------------------------------------------------------- 1 | (*s: shell/Heredoc.ml *) 2 | (*e: shell/Heredoc.ml *) 3 | -------------------------------------------------------------------------------- /tests/compiler/checking/undeclared.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | return x; 3 | } 4 | -------------------------------------------------------------------------------- /tests/compiler/parsing/auto.c: -------------------------------------------------------------------------------- 1 | 2 | void foo() { 3 | auto int x; 4 | } 5 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/3dots.c: -------------------------------------------------------------------------------- 1 | void foo(int x, ..., int y) { 2 | } 3 | -------------------------------------------------------------------------------- /tests/mk/mk-cycle: -------------------------------------------------------------------------------- 1 | 2 | foo: bar 3 | 4 | bar: foobar 5 | 6 | foobar: bar 7 | -------------------------------------------------------------------------------- /kernel/processes/sysawait.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_await : unit -> Process.wait_msg 3 | -------------------------------------------------------------------------------- /kernel/time/sysalarm.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_alarm: Types.t_ms option -> int 3 | 4 | -------------------------------------------------------------------------------- /tests/compiler/codegen/arithmetic.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | return 1 + 2.0; 3 | } 4 | -------------------------------------------------------------------------------- /tests/compiler/codegen/params.c: -------------------------------------------------------------------------------- 1 | 2 | int foo(int x) { 3 | return x; 4 | } 5 | -------------------------------------------------------------------------------- /tests/macroprocessor/macro_varargs.c: -------------------------------------------------------------------------------- 1 | 2 | #define FOO(a,b,...) a+b 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/vcs/file2: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | a 6 | c 7 | d 8 | f 9 | g 10 | -------------------------------------------------------------------------------- /compiler/TODO/Debugger.ml: -------------------------------------------------------------------------------- 1 | (* Copyright 2016 Yoann Padioleau, see copyright.txt *) 2 | -------------------------------------------------------------------------------- /compiler/TODO/Profiler.ml: -------------------------------------------------------------------------------- 1 | (* Copyright 2016 Yoann Padioleau, see copyright.txt *) 2 | -------------------------------------------------------------------------------- /lib_core/profiling/ppx/tests/optional_param.ml: -------------------------------------------------------------------------------- 1 | let foo ?a b = a + b [@@profiling] 2 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/channel.ml: -------------------------------------------------------------------------------- 1 | type t = unit 2 | 3 | let rgb24 = () 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/input/keyboard.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | type key = Rune.t 4 | 5 | -------------------------------------------------------------------------------- /shell/docs/lineage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryx/xix/HEAD/shell/docs/lineage.pdf -------------------------------------------------------------------------------- /tests/compiler/checking/label_undeclared.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | goto bar; 3 | 4 | } 5 | -------------------------------------------------------------------------------- /tests/compiler/checking/local_unused.c: -------------------------------------------------------------------------------- 1 | void foo(int a) { 2 | int b; 3 | 4 | } 5 | -------------------------------------------------------------------------------- /tests/compiler/codegen/init.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | int x = 1; 3 | return x; 4 | } 5 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/auto_global.c: -------------------------------------------------------------------------------- 1 | 2 | // illegal storage 3 | auto int x; 4 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/param_function.c: -------------------------------------------------------------------------------- 1 | void foo(int bar(int), int z) { 2 | } 3 | -------------------------------------------------------------------------------- /tests/macroprocessor/todo/include_absolute.c: -------------------------------------------------------------------------------- 1 | #include "/sys/src/libc/9syscall/sys.h" 2 | -------------------------------------------------------------------------------- /tests/mk/mk-scalar-context: -------------------------------------------------------------------------------- 1 | 2 | A=a b c d 3 | 4 | # issue an error 5 | B= x${A}y 6 | -------------------------------------------------------------------------------- /tests/mk/mk-toplevel-backquote: -------------------------------------------------------------------------------- 1 | # forbidden in mk-ocaml 2 | 3 | `echo ' Syscall.Answer.t 3 | 4 | -------------------------------------------------------------------------------- /kernel/processes/Kproc.mli: -------------------------------------------------------------------------------- 1 | 2 | val kproc : string (* name *) -> (unit -> unit) -> unit 3 | -------------------------------------------------------------------------------- /lib_core/base/Buffer.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryx/xix/HEAD/lib_core/base/Buffer.ml -------------------------------------------------------------------------------- /lib_graphics/geometry/Vector.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Point.t 3 | 4 | val v : int -> int -> t 5 | -------------------------------------------------------------------------------- /tests/compiler/checking/ident.c: -------------------------------------------------------------------------------- 1 | int foo; 2 | 3 | void main() { 4 | return bar; 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/codegen/mkfile: -------------------------------------------------------------------------------- 1 | clean nuke:V: 2 | rm -f *.[5vi] *.out *.s *.o[5vi] 3 | -------------------------------------------------------------------------------- /tests/compiler/parsing/function_pointer.c: -------------------------------------------------------------------------------- 1 | 2 | int (*foo)(int x); 3 | int *bar(int x); 4 | -------------------------------------------------------------------------------- /tests/compiler/parsing/mkfile: -------------------------------------------------------------------------------- 1 | clean nuke:V: 2 | rm -f *.5 *.out *.s *.o5 3 | 4 | -------------------------------------------------------------------------------- /tests/snapshots/xix/323ff00ac45d/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/init.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/35d2cd07dafc/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/break.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/59feb8992231/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/if.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/87b8de3216f3/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/local.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/8e6f69c3135b/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/while.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/bd8eca13fd2b/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/call.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/dbae373ebb9e/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/enum.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/fea004a3a397/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/goto.c 2 | -------------------------------------------------------------------------------- /assembler/TOPORT/ia/a.h: -------------------------------------------------------------------------------- 1 | struct Gen 2 | { 3 | vlong vval; 4 | }; 5 | 6 | EXTERN int nosched; 7 | -------------------------------------------------------------------------------- /kernel/processes/sysexec.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_exec: string (* cmd *) -> string list -> unit 3 | -------------------------------------------------------------------------------- /kernel/sysnop.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | let syscall_nop () = 4 | Print.print "Hello World!\n" 5 | -------------------------------------------------------------------------------- /tests/compiler/checking/label_unused.c: -------------------------------------------------------------------------------- 1 | int main() { 2 | unused: 3 | return 1; 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/codegen/array.c: -------------------------------------------------------------------------------- 1 | int x[10]; 2 | 3 | int foo() { 4 | 5 | return x[3]; 6 | } 7 | -------------------------------------------------------------------------------- /tests/compiler/codegen/assign.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | int x; 3 | x = 1; 4 | return x; 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/codegen/local.c: -------------------------------------------------------------------------------- 1 | int foo(int a) { 2 | int b = 1; 3 | return b + a; 4 | } 5 | -------------------------------------------------------------------------------- /tests/compiler/codegen/return.c: -------------------------------------------------------------------------------- 1 | int foo () { 2 | int z; 3 | z = 42; 4 | return z; 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/typing/type_incompatible.c: -------------------------------------------------------------------------------- 1 | typedef float foo; 2 | 3 | int x; 4 | 5 | foo x; 6 | -------------------------------------------------------------------------------- /tests/rc/rcmain.rc: -------------------------------------------------------------------------------- 1 | path=(/bin /usr/bin) 2 | ifs=' 3 | ' 4 | . -i /dev/stdin 5 | exit $status 6 | -------------------------------------------------------------------------------- /tests/snapshots/xix/11f8d5514a21/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/goto.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/2cfe73530a0b/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/enum.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/2e288e6f7135/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/trivial.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/374f7a6d8336/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/function.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/53acad3d15cb/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/params.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/9a6a01b43a19/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/if.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/b6d7b725a36f/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/call.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/b6fe43d7672d/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/if.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/b7605d831321/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/goto.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/bbf501cae659/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/simple.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/c9f41592ee0d/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/call.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/cf946fabcb27/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/init.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/d48112b4dfc3/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/init.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/d57c95967180/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/return.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/d95583667d6b/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/dowhile.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/e21e6e3afcfe/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/enum.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/f5624516e7b9/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/assign.c 2 | -------------------------------------------------------------------------------- /assembler/TOPORT/7a/a.h: -------------------------------------------------------------------------------- 1 | struct Gen 2 | { 3 | int64 offset; 4 | short xreg; 5 | short ext; 6 | }; 7 | -------------------------------------------------------------------------------- /tests/compiler/checking/enum_redeclare.c: -------------------------------------------------------------------------------- 1 | extern int Foo; 2 | 3 | enum X { 4 | Foo, 5 | }; 6 | 7 | -------------------------------------------------------------------------------- /tests/compiler/checking/function_shadow.c: -------------------------------------------------------------------------------- 1 | int x; 2 | 3 | void x(int y) { 4 | return y; 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/checking/if_empty.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | // 5c -w warns at least 3 | if(1) ; 4 | } 5 | -------------------------------------------------------------------------------- /tests/compiler/checking/tag_inconsistent.c: -------------------------------------------------------------------------------- 1 | struct Foo x; 2 | union Foo y; 3 | enum Foo z; 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/compiler/typing/typecheck.c: -------------------------------------------------------------------------------- 1 | 2 | void x(int y) { 3 | // void != int 4 | return y; 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/typing/varargs.c: -------------------------------------------------------------------------------- 1 | int foo(int, ...); 2 | 3 | int foo(int x) { 4 | return 1; 5 | } 6 | -------------------------------------------------------------------------------- /tests/macroprocessor/macro_specialchar.c: -------------------------------------------------------------------------------- 1 | #define FOO(b) b + "#a b" 2 | 3 | int x = FOO(1); 4 | 5 | -------------------------------------------------------------------------------- /tests/mk/mk-concat-vars: -------------------------------------------------------------------------------- 1 | A=foo bar 2 | B=bar foo 3 | 4 | C=$A$B 5 | 6 | all: 7 | echo $C 8 | -------------------------------------------------------------------------------- /tests/rc/caret.rc: -------------------------------------------------------------------------------- 1 | A=foo bar 2 | 3 | echo $A^.c 4 | 5 | # implicit caret insertion? 6 | echo $A.c 7 | -------------------------------------------------------------------------------- /tests/snapshots/xix/04ed11ae91db/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/local.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/104f16da38c9/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/while.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/311ce9a0eeeb/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/return.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/3ba0f42cc944/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/break.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/4eac33d61e2d/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/params.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/84bbacde138f/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/function.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/92a9a80eb7c4/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/dowhile.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/950c2b43e47d/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/trivial.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/9a9f36d8103e/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/address_local.c 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/a065f11c1073/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/local.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/aadc03502189/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/assign.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/ab2d37806ee0/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/function.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/af57b840ca0e/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/simple.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/bafef64be874/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/return.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/c28b806da432/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/params.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/c51f151f9c74/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/dowhile.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/c93eab6c9c10/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/while.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/d4f5f890c70a/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/break.c (ovc) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/e38254f497ad/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/trivial.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/ecf6e3880071/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/assign.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/f092e735ec95/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/simple.c (ovc) 2 | -------------------------------------------------------------------------------- /windows/Dev_graphical_window.ml: -------------------------------------------------------------------------------- 1 | (*s: Dev_graphical_window.ml *) 2 | (*e: Dev_graphical_window.ml *) 3 | -------------------------------------------------------------------------------- /kernel/processes/sysrfork.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_rfork: Syscall.rfork_flags -> Process.pid option 3 | 4 | -------------------------------------------------------------------------------- /kernel/time/Time_rendez.mli: -------------------------------------------------------------------------------- 1 | 2 | val sleep : Rendez.t -> (unit -> bool) -> Time.t_ms -> unit 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/compiler/checking/struct_duplicate_fields.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | int x; 3 | int x; 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /tests/macroprocessor/ifdef.c: -------------------------------------------------------------------------------- 1 | #ifdef FOO 2 | int x; 3 | int y; 4 | #endif 5 | 6 | void main() { 7 | } 8 | -------------------------------------------------------------------------------- /tests/mk/mk-empty-var: -------------------------------------------------------------------------------- 1 | 2 | LIB= 3 | HFILES=foo.c bar.c 4 | 5 | foo.o: $HFILES $LIB 6 | echo $LIB 7 | -------------------------------------------------------------------------------- /tests/snapshots/xix/35f100ebdd98/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/address_local.c (oic) 2 | -------------------------------------------------------------------------------- /tests/snapshots/xix/683a109b63ed/name: -------------------------------------------------------------------------------- 1 | compiler > codegen > tests/compiler/codegen/address_local.c (ovc) 2 | -------------------------------------------------------------------------------- /windows/Dev_graphical_window.mli: -------------------------------------------------------------------------------- 1 | (*s: Dev_graphical_window.mli *) 2 | (*e: Dev_graphical_window.mli *) 3 | -------------------------------------------------------------------------------- /kernel/concurrency/Counter.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Ref.t 3 | 4 | val alloc: int -> t 5 | 6 | val gen : t -> int 7 | -------------------------------------------------------------------------------- /kernel/memory/Proc_segment.mli: -------------------------------------------------------------------------------- 1 | 2 | val segment_of_addr : Process_.t -> Types.user_addr -> Segment.t 3 | 4 | -------------------------------------------------------------------------------- /lib_core/commons/Date.mli: -------------------------------------------------------------------------------- 1 | 2 | val string_of_day: int -> string 3 | 4 | val string_of_month: int -> string 5 | -------------------------------------------------------------------------------- /tests/compiler/checking/enum_redefined.c: -------------------------------------------------------------------------------- 1 | enum Foo { 2 | Bar1 3 | }; 4 | 5 | enum Foo { 6 | Bar2 7 | }; 8 | -------------------------------------------------------------------------------- /tests/compiler/checking/function_implicit.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | print(); 3 | 4 | //print(1); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /tests/compiler/parsing/label.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | 3 | goto label1; 4 | 5 | label1: 6 | return; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /tests/macroprocessor/errors/location.c: -------------------------------------------------------------------------------- 1 | //XXX 2 | #include "foo.h" 3 | //XXX 4 | #include "bar.h" 5 | XXX 6 | 7 | -------------------------------------------------------------------------------- /tests/macroprocessor/macro_noargs.c: -------------------------------------------------------------------------------- 1 | #define FOO() 1+2 2 | 3 | int main() { 4 | return FOO(); 5 | } 6 | 7 | -------------------------------------------------------------------------------- /tests/mk/mk-ambiguous: -------------------------------------------------------------------------------- 1 | 2 | foo.5: foo.c 3 | 5c -c foo.c 4 | 5 | foo.5: bar.c 6 | 5c -c bar.c 7 | -------------------------------------------------------------------------------- /tests/rc/if.rc: -------------------------------------------------------------------------------- 1 | #!/bin/rc 2 | 3 | if(! ~ $#* 0 1){ 4 | echo 'usage: kmem [kernel]' 5 | exit usage 6 | } 7 | -------------------------------------------------------------------------------- /compiler/TOPORT/cc/omachcap.c: -------------------------------------------------------------------------------- 1 | /* default, like old cc */ 2 | int 3 | machcap(Node *n) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /tests/assembler/test.s: -------------------------------------------------------------------------------- 1 | TEXT _main(SB), $4 2 | MOVW $42, R1 3 | ADD R10, R1, R0 4 | RET 5 | -------------------------------------------------------------------------------- /tests/compiler/codegen/simple.c: -------------------------------------------------------------------------------- 1 | int foo(int x, int y) { 2 | int z; 3 | 4 | z = x + y; 5 | return z; 6 | } 7 | -------------------------------------------------------------------------------- /tests/compiler/parsing/array_param.c: -------------------------------------------------------------------------------- 1 | typedef int jmp_buf[2]; 2 | 3 | // this is ok 4 | void foo(jmp_buf); 5 | 6 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/typedef_and_init.c: -------------------------------------------------------------------------------- 1 | 2 | //error: 5c allows it, but wrong 3 | typedef int foo = 2; 4 | -------------------------------------------------------------------------------- /tests/mk/dynrule.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo ' 4 | all:QV: 5 | echo it worked, you got a dynamic mkfile 6 | ' 7 | -------------------------------------------------------------------------------- /bin/ppx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PPX=`ocamlfind query ppx_deriving` 3 | exec $PPX/ppx_deriving package:ppx_deriving.show "$@" 4 | -------------------------------------------------------------------------------- /kernel/processes/sysexits.mli: -------------------------------------------------------------------------------- 1 | 2 | val syscall_exits: string -> unit 3 | 4 | val hooks: (Process.t -> unit) list ref 5 | -------------------------------------------------------------------------------- /tests/compiler/parsing/todo/struct_forward.c: -------------------------------------------------------------------------------- 1 | 2 | // use for this? Yes! See my notes in coccinelle. 3 | struct x; 4 | 5 | -------------------------------------------------------------------------------- /tests/macroprocessor/macro.c: -------------------------------------------------------------------------------- 1 | #define FOO 1 2 | 3 | void print(int); 4 | 5 | void main() { 6 | print(FOO); 7 | } 8 | -------------------------------------------------------------------------------- /tests/mk/mk-infinite: -------------------------------------------------------------------------------- 1 | 2 | all: foo bar 3 | 4 | %: %.5 5 | 5l $stem.5 -o $stem 6 | 7 | %.5: %.c 8 | 5c -c $stem.c 9 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # TODO: should auto generate from .gitignore! 2 | 3 | /_opamroot 4 | /mkconfig 5 | 6 | *.cm* 7 | *.o 8 | *.a 9 | -------------------------------------------------------------------------------- /env.sh: -------------------------------------------------------------------------------- 1 | #TODO: replace by MKSHELL=`pwd`/bin/orc at some point 2 | export MKSHELL=`which rc` 3 | export PATH=`pwd`/bin:$PATH 4 | -------------------------------------------------------------------------------- /kernel/core/Print.mli: -------------------------------------------------------------------------------- 1 | 2 | val print : string -> unit 3 | 4 | (* set in Main.ml *) 5 | val _print: (string -> unit) ref 6 | -------------------------------------------------------------------------------- /lib_graphics/draw/Polygon.mli: -------------------------------------------------------------------------------- 1 | 2 | val border: 3 | Image.t -> Rectangle.t -> int -> Image.t -> Point.t -> unit 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/tests/hellodraw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryx/xix/HEAD/lib_gui/lib_graphics/draw/tests/hellodraw -------------------------------------------------------------------------------- /lib_gui/lib_graphics/geometry/vector.ml: -------------------------------------------------------------------------------- 1 | open Point 2 | 3 | type t = Point.t 4 | 5 | let v x y = 6 | { x = x; y = y } 7 | -------------------------------------------------------------------------------- /tests/compiler/checking/label_redeclared.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | 3 | label1: 4 | label1: 5 | goto label1; 6 | return 1; 7 | } 8 | -------------------------------------------------------------------------------- /tests/compiler/codegen/function.c: -------------------------------------------------------------------------------- 1 | int z; 2 | 3 | int foo(int x) { 4 | int y; 5 | y = x + 2 + z; 6 | return y; 7 | } 8 | -------------------------------------------------------------------------------- /tests/compiler/parsing/typedef.c: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef uint Rune; 3 | 4 | typedef int foo; 5 | foo bar; 6 | -------------------------------------------------------------------------------- /tests/compiler/scoping/params_scope.c: -------------------------------------------------------------------------------- 1 | void foo(int x) { 2 | return x; 3 | } 4 | 5 | void bar() { 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /tests/mk/mk-backquote: -------------------------------------------------------------------------------- 1 | X=`ls *.c` 2 | Y=`ls *.c | sed 's/..$//'` 3 | 4 | all:VQ: 5 | echo $X 6 | echo $Y 7 | -------------------------------------------------------------------------------- /tests/mk/mk-fail-early: -------------------------------------------------------------------------------- 1 | 2 | all:VI: 3 | VAR=(1 2 3 4) 4 | for (i in $VAR) @{ 5 | echo $i 6 | lsss 7 | } 8 | -------------------------------------------------------------------------------- /tests/mk/mk-specialized-vs-meta: -------------------------------------------------------------------------------- 1 | 2 | %.5: %.c 3 | 5c -c $stem.c 4 | 5 | foo.5: foo.c 6 | 5c -c -specialoption $stem.c 7 | -------------------------------------------------------------------------------- /tests/rc/todo/here.rc: -------------------------------------------------------------------------------- 1 | #!/bin/rc 2 | tr ' ' '\012' < t 5 | val free: t -> unit 6 | val copy: t -> t 7 | -------------------------------------------------------------------------------- /lib_core/compression/zip.mli: -------------------------------------------------------------------------------- 1 | 2 | (* returns a compressed input that you can read from *) 3 | val deflate : IO.input -> IO.input 4 | -------------------------------------------------------------------------------- /tests/compiler/checking/struct_undefined.c: -------------------------------------------------------------------------------- 1 | // 5c does not complain; clang does. 2 | 3 | struct Foo x; 4 | 5 | struct Foo *y; 6 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/typedef_and_function.c: -------------------------------------------------------------------------------- 1 | 2 | //error: (5c allows it, but wrong) 3 | typedef int foo(int x) { 4 | } 5 | -------------------------------------------------------------------------------- /tests/macroprocessor/errors/macro_unclosed.c: -------------------------------------------------------------------------------- 1 | #define FOO(a,b) a+b 2 | 3 | 4 | int main() { 5 | return FOO(1,2 ; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /kernel/Port/portdat_console.h: -------------------------------------------------------------------------------- 1 | extern Queue* kbdq; 2 | extern Queue* kprintoq; 3 | extern Queue* serialoq; 4 | 5 | // consdevtab 6 | -------------------------------------------------------------------------------- /kernel/scheduler/Scheduler.mli: -------------------------------------------------------------------------------- 1 | 2 | val any_ready : unit -> bool 3 | 4 | val ready: Process_.t -> unit 5 | val yield: unit -> unit 6 | -------------------------------------------------------------------------------- /linker/Optimize.ml: -------------------------------------------------------------------------------- 1 | (* TODO: 2 | * - generic ADD -$N -> SUB $N 3 | * - follow (and xfol) 4 | * - brloop branch chain opti 5 | *) 6 | -------------------------------------------------------------------------------- /tests/compiler/parsing/helloworld.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() { 5 | print("hello world\n"); 6 | } 7 | -------------------------------------------------------------------------------- /tests/compiler/typing/pointer_sub.c: -------------------------------------------------------------------------------- 1 | long foo() { 2 | int *f; 3 | int *g; 4 | 5 | //return f + g; 6 | return f - g; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /tests/mk/mk-too-many-spaces: -------------------------------------------------------------------------------- 1 | # I force A= 2 | A = 1 3 | 4 | # I forbid to have space if no prereqs at all 5 | target1: 6 | echo bad 7 | -------------------------------------------------------------------------------- /compiler/TOPORT/ic/machcap.c: -------------------------------------------------------------------------------- 1 | int 2 | machcap(Node *n) 3 | { 4 | if(n == Z) /* test */ 5 | return thechar == 'j'; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /kernel/Libc/port/atof.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double 5 | atof(char *cp) 6 | { 7 | return strtod(cp, 0); 8 | } 9 | -------------------------------------------------------------------------------- /kernel/concurrency/Ilock.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Ilock_.t 3 | 4 | val alloc: unit -> t 5 | 6 | val lock: t -> unit 7 | val unlock: t -> unit 8 | -------------------------------------------------------------------------------- /kernel/concurrency_/Spl_.ml: -------------------------------------------------------------------------------- 1 | open Types 2 | 3 | (* In plan9 there is really just high or low; no intermediate *) 4 | type prio = Low | High 5 | -------------------------------------------------------------------------------- /kernel/memory/Kernel_memory.mli: -------------------------------------------------------------------------------- 1 | 2 | val kmap: Page_.t -> unit 3 | 4 | val kunmap: unit -> unit 5 | 6 | val memclear: unit -> int -> unit 7 | -------------------------------------------------------------------------------- /tests/compiler/checking/static.c: -------------------------------------------------------------------------------- 1 | // 5c forbids this one 2 | int x; 3 | 4 | static int x; 5 | 6 | // 5c only warns for this one 7 | int x; 8 | -------------------------------------------------------------------------------- /tests/compiler/checking/struct_redeclare.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | int x; 3 | }; 4 | 5 | union Foo { 6 | int y; 7 | }; 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/rc/dup.rc: -------------------------------------------------------------------------------- 1 | 2 | if(~ $#conflicting 2 || ~ $#conflicting 3){ 3 | echo 'can only use one of -b, -c or -s' >[1=2] 4 | exit usage 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/parsing/for.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | int x; 3 | x = 0; 4 | 5 | for(x = 1; x; x = 2) { 6 | x = 3; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /tests/vcs/9f4d96d5b00d98959ea9960f069585ce42b1349a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryx/xix/HEAD/tests/vcs/9f4d96d5b00d98959ea9960f069585ce42b1349a -------------------------------------------------------------------------------- /lib_graphics/draw/Font_default.mli: -------------------------------------------------------------------------------- 1 | 2 | val load_default_font: Display.t -> Font.t 3 | 4 | val load_default_subfont: Display.t -> Subfont.t 5 | 6 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/geometry/mkfile: -------------------------------------------------------------------------------- 1 | TOP=../../.. 2 | 3 | INCLUDES= 4 | SRC= point.ml vector.ml rectangle.ml 5 | 6 | <$TOP/mkconfig 7 | <$TOP/mklib 8 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/pad.txt: -------------------------------------------------------------------------------- 1 | Mostly copy paste from ../../lib_graphics but relying on OCaml Graphics 2 | module rather than the Plan 9 draw server. 3 | -------------------------------------------------------------------------------- /shell/Env.mli: -------------------------------------------------------------------------------- 1 | (*s: Env.mli *) 2 | type t = (string * string list) list 3 | 4 | val read_environment : < Cap.env ; .. > -> t 5 | 6 | (*e: Env.mli *) 7 | -------------------------------------------------------------------------------- /tests/compiler/checking/function_redeclare.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | return 1; 3 | } 4 | 5 | // 5c allows that, lol 6 | int foo() { 7 | return 2; 8 | } 9 | -------------------------------------------------------------------------------- /tests/compiler/parsing/array.c: -------------------------------------------------------------------------------- 1 | int foo[10]; 2 | 3 | int* bar[10]; 4 | 5 | // this is not an array, but a pointer to an array 6 | int (*foobar)[10]; 7 | -------------------------------------------------------------------------------- /lib_graphics/draw/Draw_ipc.mli: -------------------------------------------------------------------------------- 1 | 2 | val get_named_image: Display.t -> string (* winname *) -> Image.t 3 | 4 | val name_image: Image.t -> string -> unit 5 | -------------------------------------------------------------------------------- /lib_gui/tests/hellogui.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | let main () = 4 | let display = Draw.init "Hello GUI" in 5 | 6 | raise Todo 7 | 8 | let _ = main () 9 | -------------------------------------------------------------------------------- /tests/compiler/checking/for_useless.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | // 5c does not parse this, weird, and clang does not warn. 3 | for (int i;;) { 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/codegen/enum.c: -------------------------------------------------------------------------------- 1 | enum Foo { 2 | X1, 3 | X2, 4 | }; 5 | 6 | long foo() { 7 | enum Foo x; 8 | 9 | return x + X2; 10 | } 11 | -------------------------------------------------------------------------------- /tests/compiler/codegen/helloraw.c: -------------------------------------------------------------------------------- 1 | extern long pwrite(int, void*, long, long long); 2 | 3 | void main() { 4 | pwrite(1, "hello world\n", 12, 0); 5 | } 6 | -------------------------------------------------------------------------------- /tests/compiler/scoping/param_shadow.c: -------------------------------------------------------------------------------- 1 | void foo(int x) { 2 | // this is forbidden cos considered in same scope than parameters. 3 | int x; 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tests/mk/todo/mk-bad-space-after-antislash: -------------------------------------------------------------------------------- 1 | X1=\ 2 | foo1.c\ 3 | foo2.c\ 4 | foo3.c\ 5 | bad_space_prev_line.c 6 | 7 | xx: 8 | echo $X1 -------------------------------------------------------------------------------- /kernel/Libc/port/strlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | long 5 | strlen(char *s) 6 | { 7 | 8 | return strchr(s, 0) - s; 9 | } 10 | -------------------------------------------------------------------------------- /lib_core/commons/UChan.mli: -------------------------------------------------------------------------------- 1 | 2 | val with_open_in : 3 | (Chan.i -> 'a) -> Fpath.t -> 'a 4 | 5 | val with_open_out : 6 | (Chan.o -> 'a) -> Fpath.t -> 'a 7 | -------------------------------------------------------------------------------- /tests/compiler/codegen/dowhile.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | int x; 3 | x = 0; 4 | 5 | do { 6 | x = 1; 7 | } while (x); 8 | 9 | return x; 10 | } 11 | -------------------------------------------------------------------------------- /tests/compiler/extensions/unnamed_illegal.c: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | 3 | 4 | struct Foo { 5 | uint; 6 | int z; 7 | }; 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/macroprocessor/macro_args.c: -------------------------------------------------------------------------------- 1 | #define FOO(a,b) a+b 2 | 3 | int main() { 4 | if(1) 5 | return FOO(1,2); 6 | else 7 | return FOO (1,2); 8 | } 9 | -------------------------------------------------------------------------------- /tests/macroprocessor/macro_string.c: -------------------------------------------------------------------------------- 1 | #define foo(a) stuff(a, "a ab" "a") 2 | 3 | int stuff(int x, char* s); 4 | 5 | void main() { 6 | return foo(42); 7 | } 8 | -------------------------------------------------------------------------------- /generators/lex/CLI.mli: -------------------------------------------------------------------------------- 1 | (*s: lex/CLI.mli *) 2 | (*s: signature [[CLI.main]] *) 3 | val main: unit -> unit 4 | (*e: signature [[CLI.main]] *) 5 | (*e: lex/CLI.mli *) 6 | -------------------------------------------------------------------------------- /lib_core/commons/Bits.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = (int * int) list 3 | [@@deriving show] 4 | 5 | type int32 = t 6 | type int64 = t 7 | 8 | val int_of_bits32: int32 -> int 9 | -------------------------------------------------------------------------------- /shell/Fn.mli: -------------------------------------------------------------------------------- 1 | (*s: Fn.mli *) 2 | (*s: signature [[Fn.flook]] *) 3 | val flook : string -> Runtime.fn option 4 | (*e: signature [[Fn.flook]] *) 5 | (*e: Fn.mli *) 6 | -------------------------------------------------------------------------------- /tests/assembler/macro.s: -------------------------------------------------------------------------------- 1 | #define CST 42 2 | 3 | TEXT _main(SB), $4 4 | MOVW $CST, R1 5 | ADD R10, R1, R0 6 | RET 7 | -------------------------------------------------------------------------------- /tests/compiler/codegen/break.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | int x; 3 | x = 1; 4 | 5 | while(x) { 6 | x = 2; 7 | break; 8 | } 9 | return x; 10 | } 11 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/cast_storage.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | // syntax error, but in 5c says: 'illegal combination of class' 3 | return (extern int) 1; 4 | } 5 | -------------------------------------------------------------------------------- /tests/mk/mkfile: -------------------------------------------------------------------------------- 1 | MKSHELL=/home/pad/packages/stow/plan9port/bin/rc 2 | MK=../mk -v 3 | 4 | %:V: 5 | $MK -f $target 6 | 7 | clean nuke:V: 8 | rm -f *.5 foo 9 | -------------------------------------------------------------------------------- /utilities/files/pwd.ml: -------------------------------------------------------------------------------- 1 | 2 | (* alt: let _main = Printf.printf "%s\n" (Sys.getcwd()) *) 3 | let _ = 4 | Cap.main (fun caps -> Console.print caps (Sys.getcwd())) 5 | -------------------------------------------------------------------------------- /lib_core/crypto/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_crypto) 3 | (wrapped false) 4 | (libraries 5 | xix_commons 6 | ) 7 | (preprocess (pps ppx_deriving.show)) 8 | ) 9 | -------------------------------------------------------------------------------- /lib_core/parsing/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../.. 4 | INCLUDES=-I . 5 | 6 | SRC=Lexing.ml Parsing.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /kernel/concurrency/Spl.mli: -------------------------------------------------------------------------------- 1 | 2 | type prio = Spl_.prio 3 | 4 | val high: unit -> prio 5 | val low: unit -> prio 6 | 7 | val set: prio -> unit 8 | val is_low: unit -> bool 9 | -------------------------------------------------------------------------------- /tests/assembler/quote.s: -------------------------------------------------------------------------------- 1 | TEXT foo(SB), $0 2 | // 3 | //MOVW 'A', R1 4 | 5 | MOVW $'A', R1 6 | MOVW $''', R2 7 | MOVW $'\'', R2 8 | -------------------------------------------------------------------------------- /tests/mk/mk-ambiguous-simple: -------------------------------------------------------------------------------- 1 | all: foo 2 | 3 | foo: foo.5 4 | 5l -o foo foo.5 5 | 6 | foo.5: foo.c 7 | 5c -c foo.c 8 | foo.5: foo.h 9 | 5c -g -c foo.c 10 | -------------------------------------------------------------------------------- /kernel/Libc/port/abs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | abs(int a) 6 | { 7 | if(a < 0) 8 | return -a; 9 | return a; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /kernel/scheduler/Rendez.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Rendez_.t 3 | 4 | val alloc: unit -> t 5 | 6 | val wakeup: t -> Types.pid option 7 | val sleep: t -> (unit -> bool) (* fcond *) -> unit 8 | -------------------------------------------------------------------------------- /lib_core/compression/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_compression) 3 | (wrapped false) 4 | (libraries 5 | xix_commons 6 | ) 7 | (preprocess (pps ppx_deriving.show)) 8 | ) 9 | -------------------------------------------------------------------------------- /lib_core/system/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../.. 4 | INCLUDES=-I . 5 | 6 | SRC=\ 7 | Sys.ml Filename.ml Arg.ml 8 | 9 | <$TOP/mkconfig 10 | <$TOP/mkfiles/mklib 11 | -------------------------------------------------------------------------------- /lib_graphics/draw/Text.mli: -------------------------------------------------------------------------------- 1 | 2 | val string_width: Font.t -> string -> int 3 | 4 | val string: 5 | Image.t -> Point.t -> Image.t -> Point.t -> Font.t -> string -> Point.t 6 | -------------------------------------------------------------------------------- /scripts/skeleton_latex.rc: -------------------------------------------------------------------------------- 1 | #!/Users/pad/goken/bin/rc -m /Users/pad/goken/etc/rcmain.unix 2 | 3 | grep -E '^\\(chapter|section|subsection|label|appendix)|^%\*\*\*|^%---|^%###' $* 4 | -------------------------------------------------------------------------------- /tests/compiler/checking/tag_redeclared.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | int x; 3 | }; 4 | 5 | struct Foo { 6 | int x; 7 | int y; 8 | }; 9 | 10 | enum Foo { 11 | Bar 12 | }; 13 | -------------------------------------------------------------------------------- /tests/compiler/codegen/pointer.c: -------------------------------------------------------------------------------- 1 | int x; 2 | 3 | int foo() { 4 | int *y; 5 | 6 | x = 42; 7 | 8 | y = &x; 9 | 10 | *y = 1; 11 | 12 | return *y; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /windows/Dev_wm.mli: -------------------------------------------------------------------------------- 1 | (*s: Dev_wm.mli *) 2 | 3 | (*s: signature [[Dev_wm.dev_winid]] *) 4 | val dev_winid: Device.t 5 | (*e: signature [[Dev_wm.dev_winid]] *) 6 | (*e: Dev_wm.mli *) 7 | -------------------------------------------------------------------------------- /generators/yacc/CLI.mli: -------------------------------------------------------------------------------- 1 | (*s: yacc/CLI.mli *) 2 | (*s: signature [[CLI.main]](yacc) *) 3 | val main: unit -> unit 4 | (*e: signature [[CLI.main]](yacc) *) 5 | 6 | (*e: yacc/CLI.mli *) 7 | -------------------------------------------------------------------------------- /lib_gui/mkfile: -------------------------------------------------------------------------------- 1 | TOP=.. 2 | 3 | INCLUDES=-I $TOP/lib_core/collections -I $TOP/lib_core/commons 4 | 5 | SRC=widget.ml \ 6 | label.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mklib 10 | -------------------------------------------------------------------------------- /macroprocessor/CLI.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * todo: 3 | * - make it an independent program and a library (so avoid some forks) 4 | * - compare to https://github.com/mjambon/cppo? 5 | *) 6 | -------------------------------------------------------------------------------- /tests/compiler/parsing/struct.c: -------------------------------------------------------------------------------- 1 | 2 | struct Foo x; 3 | 4 | // should warn! 5c does not (clang does) 5 | struct Bar y; 6 | 7 | struct Foo { 8 | int x; 9 | int y; 10 | }; 11 | -------------------------------------------------------------------------------- /kernel/core/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES=-I $TOP/lib_core/commons 5 | SRC= Arch.ml Conf.ml Error.ml Types.ml Print.ml 6 | 7 | <$TOP/mkconfig 8 | <$TOP/mkfiles/mklib 9 | -------------------------------------------------------------------------------- /lib_core/printing/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../.. 4 | INCLUDES=-I . 5 | 6 | SRC=\ 7 | Printf.ml Printexc.ml Format.ml 8 | 9 | <$TOP/mkconfig 10 | <$TOP/mkfiles/mklib 11 | -------------------------------------------------------------------------------- /lib_core/profiling/ppx/dune: -------------------------------------------------------------------------------- 1 | (library 2 | ;(public_name profiling.ppx) 3 | (name ppx_profiling) 4 | (kind ppx_deriver) 5 | (libraries 6 | ;commons 7 | ppxlib 8 | ) 9 | ) 10 | -------------------------------------------------------------------------------- /shell/Parse.mli: -------------------------------------------------------------------------------- 1 | (*s: Parse.mli *) 2 | (*s: signature [[Parse.parse_line]] *) 3 | val parse_line : Lexing.lexbuf -> Ast.line 4 | (*e: signature [[Parse.parse_line]] *) 5 | (*e: Parse.mli *) 6 | -------------------------------------------------------------------------------- /tests/compiler/checking/field.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | int x; 3 | int y; 4 | }; 5 | 6 | int foo() { 7 | struct Foo foo; 8 | 9 | return foo.z; // undefined field 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/compiler/checking/typedef_redefined.c: -------------------------------------------------------------------------------- 1 | typedef int foo; 2 | 3 | // 5c says nothing, clang warns because it is a C11 feature 4 | typedef int foo; 5 | 6 | //typedef float foo; 7 | 8 | -------------------------------------------------------------------------------- /tests/compiler/typing/and.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | // short x; this generates an error 3 | int x; 4 | // 5c has as special case for int and float. Not sure why. 5 | return x & 1.3; 6 | } 7 | -------------------------------------------------------------------------------- /tests/mk/mk-vacuous: -------------------------------------------------------------------------------- 1 | # run with -v to see mk detecting vacuous nodes 2 | 3 | all: foo.o 4 | 5 | %.o: %.c 6 | echo compiler 7 | 8 | %.o: %.s 9 | echo assembler 10 | -------------------------------------------------------------------------------- /compiler/Arch5.mli: -------------------------------------------------------------------------------- 1 | (*s: Arch5.mli *) 2 | 3 | (*s: signature [[Arch5.arch]] *) 4 | val arch: Ast_asm5.instr_with_cond Arch_compiler.t 5 | (*e: signature [[Arch5.arch]] *) 6 | (*e: Arch5.mli *) 7 | -------------------------------------------------------------------------------- /kernel/Bcm/dat_forward.h: -------------------------------------------------------------------------------- 1 | // could be in portdat_forward.h 2 | typedef struct Arch_FPsave Arch_FPsave; 3 | typedef struct Ureg Ureg; 4 | #pragma incomplete Ureg 5 | 6 | typedef struct Soc Soc; 7 | -------------------------------------------------------------------------------- /kernel/Libc/port/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double 5 | fabs(double arg) 6 | { 7 | 8 | if(arg < 0) 9 | return -arg; 10 | return arg; 11 | } 12 | -------------------------------------------------------------------------------- /kernel/Port/portfns_security.h: -------------------------------------------------------------------------------- 1 | 2 | // auth.c 3 | long userwrite(char*, int); 4 | long hostdomainwrite(char*, int); 5 | long hostownerwrite(char*, int); 6 | 7 | // and some sysxxx functions 8 | -------------------------------------------------------------------------------- /kernel/concurrency/Rwlock.mli: -------------------------------------------------------------------------------- 1 | type t 2 | 3 | val rlock: t -> unit 4 | val runlock: t -> unit 5 | 6 | val wlock: t -> unit 7 | val wunlock: t -> unit 8 | 9 | val canrlock: t -> bool 10 | -------------------------------------------------------------------------------- /lib_graphics/geometry/mkfile: -------------------------------------------------------------------------------- 1 | 2 | TOP=../.. 3 | 4 | INCLUDES= -I $TOP/lib_core/commons 5 | 6 | SRC=Point.ml Vector.ml Rectangle.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/input/mkfile: -------------------------------------------------------------------------------- 1 | TOP=../../.. 2 | 3 | INCLUDES=-I $TOP/lib_core/commons -I ../geometry 4 | SRC= rune.ml cursor.ml mouse.ml keyboard.ml 5 | 6 | <$TOP/mkconfig 7 | <$TOP/mklib 8 | -------------------------------------------------------------------------------- /tests/compiler/parsing/stricter/typedef_useless.c: -------------------------------------------------------------------------------- 1 | // 5c says nothing, clang warns about missing declaration, 2 | // I generate a syntax error. I force to have a type with a storage. 3 | typedef; 4 | -------------------------------------------------------------------------------- /linker/executables/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../.. 4 | 5 | INCLUDES=-I $TOP/lib_core/commons 6 | SRC=Exec_file.ml A_out.ml Elf.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /shell/Compile.mli: -------------------------------------------------------------------------------- 1 | (*s: Compile.mli *) 2 | (*s: signature [[Compile.compile]] *) 3 | val compile : Ast.cmd_sequence -> Opcode.codevec 4 | (*e: signature [[Compile.compile]] *) 5 | (*e: Compile.mli *) 6 | -------------------------------------------------------------------------------- /tests/compiler/codegen/call.c: -------------------------------------------------------------------------------- 1 | int foo(int i) { 2 | int y; 3 | y = 2; 4 | return i + y; 5 | } 6 | 7 | int bar() { 8 | int x; 9 | x = 0; 10 | return foo(x); 11 | } 12 | -------------------------------------------------------------------------------- /tests/compiler/codegen/goto.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | int x; 3 | 4 | x = 0; 5 | goto L1; 6 | x = 1; 7 | goto L1; 8 | x = 2; 9 | 10 | L1: 11 | x = 3; 12 | 13 | return x; 14 | } 15 | -------------------------------------------------------------------------------- /utilities/text/ed/Main.ml: -------------------------------------------------------------------------------- 1 | let _ = 2 | Cap.main (fun (caps : Cap.all_caps) -> 3 | let argv = CapSys.argv caps in 4 | Exit.exit caps (Exit.catch (fun () -> CLI.main caps argv)) 5 | ) 6 | -------------------------------------------------------------------------------- /lib_core/commons/UConsole.ml: -------------------------------------------------------------------------------- 1 | (* %! is to flush *) 2 | 3 | let print str = Printf.printf "%s\n%!" str 4 | let print_no_nl str = Printf.printf "%s%!" str 5 | let eprint str = Printf.eprintf "%s\n%!" str 6 | -------------------------------------------------------------------------------- /lib_core/system/plan9/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../../.. 4 | INCLUDES=-I . -I $TOP/lib_core/commons 5 | 6 | SRC=Plan9.ml Protocol_9P.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /lib_graphics/draw/Draw_rio.mli: -------------------------------------------------------------------------------- 1 | 2 | val window_border_size : int 3 | 4 | (* will access /dev/winname to get the view image for the window *) 5 | val get_view: -> Display.t -> Image.t 6 | -------------------------------------------------------------------------------- /lib_graphics/geometry/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_geometry) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | xix_commons 7 | ) 8 | (preprocess (pps ppx_deriving.show)) 9 | ) 10 | -------------------------------------------------------------------------------- /linker/executables/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_executables) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | xix_commons 7 | ) 8 | (preprocess (pps ppx_deriving.show)) 9 | ) 10 | -------------------------------------------------------------------------------- /tests/compiler/codegen/while.c: -------------------------------------------------------------------------------- 1 | int foo() { 2 | int x; 3 | x = 0; 4 | 5 | //while(x <= 42) { 6 | // x = x + 1; 7 | //} 8 | while(x) { 9 | x = 1; 10 | } 11 | return x; 12 | } 13 | -------------------------------------------------------------------------------- /kernel/Libgeometry/misc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | ulong drawld2chan[] = { 6 | GREY1, 7 | GREY2, 8 | GREY4, 9 | 10 | CMAP8, 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /kernel/concurrency_/Ref_.ml: -------------------------------------------------------------------------------- 1 | 2 | (* we can not put this type in concurrency/ because of mutual deps 3 | * between refs and a proc 4 | *) 5 | type t = { 6 | mutable cnt: int; 7 | l: Spinlock_.t; 8 | } 9 | -------------------------------------------------------------------------------- /lib_core/collections/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../.. 4 | INCLUDES=-I . 5 | 6 | SRC=List.ml Stack.ml Array.ml Hashtbl.ml Queue.ml Set.ml Map.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/line.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | type end_line = 4 | | EndSquare 5 | | EndDisc 6 | | EndArrow 7 | 8 | let line dst p0 p1 end0 end1 radius src sp = 9 | raise Todo 10 | 11 | -------------------------------------------------------------------------------- /linker/libraries/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../.. 4 | 5 | INCLUDES=-I $TOP/lib_core/commons -I $TOP/assembler/objects 6 | SRC=Library_file.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /tests/macroprocessor/macro_sharpsharp.c: -------------------------------------------------------------------------------- 1 | // this feature is used in the code of ocaml for CAMLparam macros 2 | 3 | #define FOO(a) int xx__##a; 4 | 5 | int main(void) { 6 | FOO(i); 7 | return xx__i; 8 | } 9 | -------------------------------------------------------------------------------- /assembler/objects/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_objects) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | xix_commons 7 | xix_cpp 8 | ) 9 | (preprocess (pps ppx_deriving.show)) 10 | ) 11 | -------------------------------------------------------------------------------- /kernel/core/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_core) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | ) 9 | (preprocess (pps ppx_deriving.show)) 10 | ) 11 | -------------------------------------------------------------------------------- /kernel/memory/Segment.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Segment_.t 3 | type kind = Segment_.kind 4 | 5 | val alloc: Segment_.kind -> Types.user_addr -> int -> t 6 | val free: t -> unit 7 | val copy: t -> t 8 | val share: t -> t 9 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | Xix is Xix. 2 | 3 | This is the first fully recursive acronym for a project. 4 | 5 | This repository contains mostly Plan 9 programs ported to OCaml. 6 | 7 | XiX is not ready yet though, stay tuned. 8 | -------------------------------------------------------------------------------- /shell/tests/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_shell_tests) 3 | (wrapped false) 4 | (libraries 5 | testo 6 | xix_commons 7 | 8 | xix_shell 9 | ) 10 | (preprocess (pps ppx_deriving.show)) 11 | ) 12 | -------------------------------------------------------------------------------- /tests/compiler/parsing/errors/type_illegal.c: -------------------------------------------------------------------------------- 1 | // I generate a syntax error, 5c says "duplicate types given ..." 2 | struct Foo int x; 3 | 4 | // 5c says "illegal combination of types ..." 5 | int float y; 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/compiler/start_arm.s: -------------------------------------------------------------------------------- 1 | TEXT _start(SB), $0 2 | #ifdef arm_ 3 | // needed for 5l_; without this only "Hello C world" 4 | // is printed and not "It works!" 5 | MOVW $setR12(SB), R12 6 | #endif 7 | BL main(SB) 8 | -------------------------------------------------------------------------------- /tests/compiler/typing/array_typechecking.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | int a[10]; 3 | int b[5]; 4 | int *c; 5 | 6 | float *x; 7 | 8 | //x = b; 9 | //c = a; 10 | a = c; // not an l-value! 11 | 12 | } 13 | -------------------------------------------------------------------------------- /compiler/tests/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_compiler_tests) 3 | (wrapped false) 4 | (libraries 5 | testo 6 | xix_commons 7 | 8 | xix_compiler 9 | ) 10 | (preprocess (pps ppx_deriving.show)) 11 | ) 12 | -------------------------------------------------------------------------------- /kernel/Include/cursor.h: -------------------------------------------------------------------------------- 1 | #pragma src "/sys/src/libdraw" 2 | 3 | typedef struct Cursor Cursor; 4 | 5 | struct Cursor 6 | { 7 | Point offset; 8 | 9 | byte clr[2*16]; 10 | byte set[2*16]; 11 | }; 12 | -------------------------------------------------------------------------------- /kernel/concurrency/Qlock.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Qlock_.t 3 | 4 | val alloc: unit -> t 5 | 6 | val lock : t -> unit 7 | val unlock: t -> unit 8 | val canlock: t -> bool 9 | val with_lock: (unit -> 'a) -> t -> 'a 10 | -------------------------------------------------------------------------------- /kernel/concurrency_/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_concurrency_) 3 | (wrapped false) 4 | (libraries 5 | xix_commons 6 | xix_kernel_core 7 | ) 8 | (preprocess (pps ppx_deriving.show)) 9 | ) 10 | -------------------------------------------------------------------------------- /lib_core/commons/Ord.mli: -------------------------------------------------------------------------------- 1 | type t = Less | Equal | Greater 2 | 3 | module Operators : sig 4 | (* Perl inspired *) 5 | val (<=>): 'a -> 'a -> t 6 | end 7 | 8 | val to_comparison : ('a -> 'a -> int) -> 'a -> 'a -> t 9 | -------------------------------------------------------------------------------- /lib_core/system/plan9/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_plan9) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | ) 9 | (preprocess (pps ppx_deriving.show)) 10 | ) 11 | -------------------------------------------------------------------------------- /assembler/Parse_asmi.mli: -------------------------------------------------------------------------------- 1 | (* will preprocess the code internally first *) 2 | val parse: 3 | < Cap.open_in; .. > -> Preprocessor.conf -> Fpath.t -> Ast_asmi.program 4 | 5 | val parse_no_cpp: Chan.i -> Ast_asmi.program 6 | -------------------------------------------------------------------------------- /kernel/Port/portfns_network.h: -------------------------------------------------------------------------------- 1 | 2 | void hnputl(void*, uint); 3 | void hnputs(void*, ushort); 4 | uint nhgetl(void*); 5 | ushort nhgets(void*); 6 | 7 | //void hnputv(void*, uvlong); 8 | //uvlong nhgetv(void*); 9 | -------------------------------------------------------------------------------- /kernel/concurrency/Spinlock.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Spinlock_.t 3 | 4 | val alloc: unit -> t 5 | 6 | val lock: t -> unit 7 | val unlock: t -> unit 8 | val canlock: t -> bool 9 | val with_lock : (unit -> 'a) -> t -> 'a 10 | -------------------------------------------------------------------------------- /kernel/concurrency_/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES=-I $TOP/lib_core/commons -I ../core 5 | SRC= Spl_.ml Ilock_.ml Spinlock_.ml Qlock_.ml Ref_.ml Rendez_.ml 6 | 7 | <$TOP/mkconfig 8 | <$TOP/mkfiles/mklib 9 | -------------------------------------------------------------------------------- /lib_core/commons/Logs_.mli: -------------------------------------------------------------------------------- 1 | 2 | val setup : 3 | Logs.level option -> unit -> unit 4 | 5 | (* the -verbose/-debug/-quiet CLI flags *) 6 | val cli_flags : 7 | Logs.level option ref -> (Arg.key * Arg.spec * Arg.doc) list 8 | -------------------------------------------------------------------------------- /mkfiles/mkconfig.basic: -------------------------------------------------------------------------------- 1 | COMPFLAGS= 2 | OPTFLAGS=$COMPFLAGS 3 | LINKFLAGS=-g -custom 4 | OPTLINKFLAGS= 5 | OCAMLC=ocamlc 6 | OCAMLLEX=ocamllex 7 | OCAMLYACC=ocamlyacc -v 8 | OCAMLDEP=ocamldep 9 | OCAMLOPT=ocamlopt 10 | -------------------------------------------------------------------------------- /tests/compiler/scoping/enum_shadowing.c: -------------------------------------------------------------------------------- 1 | int X; 2 | 3 | enum foo { 4 | X = 1, 5 | }; 6 | 7 | 8 | int y = X; 9 | 10 | void foo() { 11 | enum foo { 12 | X = 1, 13 | }; 14 | 15 | int y = X; 16 | } 17 | -------------------------------------------------------------------------------- /tests/compiler/typing/param_array.c: -------------------------------------------------------------------------------- 1 | void foo(int x[42]) { 2 | 3 | } 4 | 5 | int main() { 6 | // 5c and clang says nothing => better forbid state size of array in foo 7 | int y[43]; 8 | 9 | foo(y); 10 | } 11 | -------------------------------------------------------------------------------- /kernel/Port/portfns_syscalls.h: -------------------------------------------------------------------------------- 1 | // syscallfmt.c (but called only from arch-specific) 2 | void syscallfmt(int syscallno, ulong pc, va_list list); 3 | void sysretfmt(int syscallno, va_list list, long ret, uvlong start, uvlong stop); 4 | -------------------------------------------------------------------------------- /kernel/concurrency/Ref.mli: -------------------------------------------------------------------------------- 1 | type t = Ref_.t 2 | 3 | val alloc: int -> t 4 | 5 | val inc: t -> int 6 | val dec: t -> int 7 | 8 | val dec_and_is_zero : t -> bool 9 | 10 | val lock: t -> unit 11 | val unlock: t -> unit 12 | -------------------------------------------------------------------------------- /tests/mk/make-cycle: -------------------------------------------------------------------------------- 1 | foo: foo.5 bar.5 2 | 5l -o foo foo.5 bar.5 3 | %.5: %.c 4 | 5c -c $^ 5 | 6 | foo.5: foo.h 7 | bar.5: foo.h 8 | 9 | VERSION=2 10 | foo.h: foo 11 | cat foo.inc | sed -e s/VERSION/$VERSION/ > foo.h 12 | -------------------------------------------------------------------------------- /tests/rc/backquote.rc: -------------------------------------------------------------------------------- 1 | #!/bin/rc 2 | 3 | rfork e 4 | 5 | flagfmt='a,b,c,d,s,f binary,r res,x width' 6 | args='name | pid list' 7 | if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0){ 8 | aux/usage 9 | exit usage 10 | } 11 | -------------------------------------------------------------------------------- /dune-project: -------------------------------------------------------------------------------- 1 | (lang dune 2.7) 2 | ; 3.0 is better to avoid some broken link annoying error messages 3 | ; but 3.0 is generating some .pp.ml that get codegraph_build and mk index 4 | ; confused so let's keep 2.7 for now 5 | (name xix) 6 | -------------------------------------------------------------------------------- /lib_graphics/draw/Layer.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Image.t 3 | 4 | val alloc: Baselayer.t -> Rectangle.t -> Color.t -> t 5 | 6 | val free: t -> unit 7 | 8 | val put_to_top: t -> unit 9 | 10 | val put_to_bottom: t -> unit 11 | 12 | -------------------------------------------------------------------------------- /lib_graphics/draw/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_draw) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_geometry 9 | ) 10 | (preprocess (pps ppx_deriving.show)) 11 | ) 12 | -------------------------------------------------------------------------------- /vcs/clients.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/clients.mli *) 2 | 3 | (*s: signature [[Clients.client_of_url]] *) 4 | val client_of_url: string -> Client.t 5 | (*e: signature [[Clients.client_of_url]] *) 6 | (*e: version_control/clients.mli *) 7 | -------------------------------------------------------------------------------- /kernel/Port/portfns_interrupts.h: -------------------------------------------------------------------------------- 1 | 2 | // /trap.c (used in arch specific) 3 | void arch_intrenable(int, void (*)(Ureg*, void*), void*, int, char*); 4 | 5 | // /trap.c (called from main) 6 | void arch__trapinit(void); 7 | 8 | -------------------------------------------------------------------------------- /kernel/time/Timer.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = Timer_.t 3 | type mode = Timer_.mode 4 | 5 | val alloc : mode -> Time.t_ns -> (unit -> unit) -> t 6 | 7 | val add : t -> t list -> t list * int option 8 | val del : t -> t list -> t list * int option 9 | -------------------------------------------------------------------------------- /lib_graphics/draw/Line.mli: -------------------------------------------------------------------------------- 1 | 2 | type end_line = 3 | | EndSquare 4 | | EndDisc 5 | | EndArrow 6 | 7 | val line: 8 | Image.t -> Point.t -> Point.t -> end_line -> end_line -> int -> Image.t -> 9 | Point.t -> unit 10 | 11 | -------------------------------------------------------------------------------- /lib_graphics/ui/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES=-I $TOP/lib_core/commons -I ../draw -I ../geometry -I ../input 5 | SRC= Menu_ui.ml Text_ui.ml Frame_ui.ml Selection_ui.ml 6 | 7 | <$TOP/mkconfig 8 | <$TOP/mkfiles/mklib 9 | -------------------------------------------------------------------------------- /linker/libraries/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_libraries) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | xix_commons 7 | xix_cpp 8 | xix_objects 9 | ) 10 | (preprocess (pps ppx_deriving.show)) 11 | ) 12 | -------------------------------------------------------------------------------- /tests/mk/mk-cycle-bis: -------------------------------------------------------------------------------- 1 | foo: foo.5 bar.5 2 | 5l -o foo foo.5 bar.5 3 | %.5: %.c 4 | 5c -c $stem 5 | foo.5: foo.h 6 | bar.5: foo.h 7 | 8 | VERSION=2 9 | foo.h: foo 10 | cat foo.inc | sed -e s/VERSION/$VERSION/ > foo.h 11 | -------------------------------------------------------------------------------- /tests/rc/for.rc: -------------------------------------------------------------------------------- 1 | for(i){ 2 | if(test -f $i) go $i 3 | if not if(test -f /bin/$i) go /bin/$i 4 | if not if(test -f /bin/*/$i) go /bin/*/$i 5 | if not if(test -f /bin/*/*/$i) go /bin/*/*/$i 6 | if not echo 'src: can''t find '$i 7 | } 8 | -------------------------------------------------------------------------------- /windows/Dev_textual_window.mli: -------------------------------------------------------------------------------- 1 | (*s: Dev_textual_window.mli *) 2 | 3 | (*s: signature [[Dev_textual_window.dev_text]] *) 4 | val dev_text: Device.t 5 | (*e: signature [[Dev_textual_window.dev_text]] *) 6 | (*e: Dev_textual_window.mli *) 7 | -------------------------------------------------------------------------------- /assembler/Check_asm5.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * less: could make sure 3 | * - TEXT size is multiple of 4 4 | * - DATA size is > 0 5 | * 6 | * The checks for use-of-undeclared label or label redeclaration 7 | * are done in resolve_labels5.ml 8 | *) 9 | -------------------------------------------------------------------------------- /compiler/Rewrite.mli: -------------------------------------------------------------------------------- 1 | (*s: Rewrite.mli *) 2 | val rewrite: Typecheck.typed_program -> Typecheck.typed_program 3 | 4 | type error = Check.error 5 | exception Error of error 6 | val string_of_error: error -> string 7 | 8 | (*e: Rewrite.mli *) 9 | -------------------------------------------------------------------------------- /lib_core/system/plan9/plan9support.h: -------------------------------------------------------------------------------- 1 | 2 | // from syscall.h 3 | #define ERRMAX 128 4 | 5 | #define Nothing ((value) 0) 6 | 7 | extern void plan9_error (char * cmdname, value arg) Noreturn; 8 | extern void p9error (char * cmdname) Noreturn; 9 | -------------------------------------------------------------------------------- /tests/compiler/parsing/stricter/extern.c: -------------------------------------------------------------------------------- 1 | 2 | // clang issues a warning (-Wextern-initializer), 5c says nothing, hmm 3 | extern int x = 1; 4 | 5 | // clang says nothing here, but it should I think. 6 | extern int foo() { 7 | return 1; 8 | } 9 | -------------------------------------------------------------------------------- /tests/snapshots/xix/2e288e6f7135/stdxxx: -------------------------------------------------------------------------------- 1 | 0: Pseudo( 2 | TEXT({name="foo"; priv=None; sig=None; }, {dupok=false; no_prof=false; }, 0)) 3 | 1: (MOVE(Word, None, Imsr(Imm(42)), Imsr(Reg(R(0)))), AL) 4 | 2: Virtual(RET) 5 | 3: Virtual(RET) 6 | -------------------------------------------------------------------------------- /kernel/arch/arm.ml: -------------------------------------------------------------------------------- 1 | (* memory-mapped IO *) 2 | (* less: raspberry-specific *) 3 | let physIO = P (0x3F000000) (* raspi1 = 0x20000000 *) 4 | let virtIO = V (0x3E000000, Kernel) (* TODO: should be 0x7E000000 *) 5 | 6 | let arch = { 7 | x = 1; 8 | } 9 | -------------------------------------------------------------------------------- /tests/compiler/lexing/escaped_newline.c: -------------------------------------------------------------------------------- 1 | // Can you have escaped newline in string inside macro? 2 | #define FOO a\ 3 | + b 4 | 5 | char *str = "foo\ 6 | bcd"; 7 | 8 | char c = '\ 9 | a'; 10 | 11 | void main() { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /tests/compiler/parsing/stricter/function_typedef.c: -------------------------------------------------------------------------------- 1 | typedef int foo(int x); 2 | 3 | foo bar; 4 | 5 | // 5c allows that because resolve type during parsing, clang does not. 6 | // but can you access the parameter in the body?? 7 | foo bar { 8 | } 9 | -------------------------------------------------------------------------------- /vcs/client_local.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/client_local.mli *) 2 | 3 | (*s: signature [[Client_local.mk_client]] *) 4 | val mk_client: Fpath.t -> Client.t 5 | (*e: signature [[Client_local.mk_client]] *) 6 | (*e: version_control/client_local.mli *) 7 | -------------------------------------------------------------------------------- /windows/Virtual_draw.mli: -------------------------------------------------------------------------------- 1 | (*s: Virtual_draw.mli *) 2 | 3 | (*s: signature [[Virtual_draw.dev_winname]] *) 4 | (* virtual "/dev/winname" *) 5 | val dev_winname: Device.t 6 | (*e: signature [[Virtual_draw.dev_winname]] *) 7 | (*e: Virtual_draw.mli *) 8 | -------------------------------------------------------------------------------- /generators/yacc/pad.txt: -------------------------------------------------------------------------------- 1 | Imported from ocaml-light/yacc2/. 2 | The literate document is in plan9/generators/CompilerGenerator.nw 3 | This literate document is using syncweb https://github.com/aryx/syncweb 4 | hence the presence of those .md5sum_xxx files. 5 | -------------------------------------------------------------------------------- /kernel/Bcm/dat_arch.h: -------------------------------------------------------------------------------- 1 | 2 | struct Soc { /* SoC dependent configuration */ 3 | ulong dramsize; 4 | uintptr physio; 5 | uintptr busdram; 6 | uintptr busio; 7 | uintptr armlocal; 8 | }; 9 | 10 | extern Soc soc; 11 | -------------------------------------------------------------------------------- /lib_core/commons/Tmp.mli: -------------------------------------------------------------------------------- 1 | 2 | val new_file: -> 3 | string (* prefix *) -> Fpath.ext (* suffix *) -> Fpath.t 4 | 5 | val with_new_file: -> 6 | string (* prefix *) -> Fpath.ext (* suffix *) -> 7 | (Fpath.t -> 'a) -> 'a 8 | -------------------------------------------------------------------------------- /lib_core/commons/UConsole.mli: -------------------------------------------------------------------------------- 1 | (* See Console.mli for more information 2 | * 3 | * DO NOT USE THIS FILE! You should use Console.mli instead. 4 | *) 5 | 6 | val print : string -> unit 7 | val print_no_nl : string -> unit 8 | val eprint : string -> unit 9 | -------------------------------------------------------------------------------- /lib_graphics/geometry/Point.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = { 3 | x: int; 4 | y: int; 5 | } 6 | 7 | val p: int -> int -> t 8 | 9 | val zero: t 10 | 11 | val add: t -> t -> t 12 | val sub: t -> t -> t 13 | val mul: t -> t -> t 14 | val div: t -> t -> t 15 | -------------------------------------------------------------------------------- /tests/snapshots/xix/53acad3d15cb/stdxxx: -------------------------------------------------------------------------------- 1 | 0: Pseudo( 2 | TEXT({name="foo"; priv=None; sig=None; }, {dupok=false; no_prof=false; }, 0)) 3 | 1: (MOVE(Word, None, Entity(Param(Some("x"), 0)), Imsr(Reg(R(0)))), AL) 4 | 2: Virtual(RET) 5 | 3: Virtual(RET) 6 | -------------------------------------------------------------------------------- /vcs/diff_basic.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/diff_basic.mli *) 2 | 3 | (*s: signature [[Diff_basic.diff]] *) 4 | val diff: string array -> string array -> Diff.diff 5 | (*e: signature [[Diff_basic.diff]] *) 6 | 7 | (*e: version_control/diff_basic.mli *) 8 | -------------------------------------------------------------------------------- /linker/Flags.ml: -------------------------------------------------------------------------------- 1 | 2 | (* set by '-debug_layout' (was set by ?? in 5l/vl/... ?) *) 3 | let debug_layout = ref false 4 | (* set by '-debug_gen' (was set by '-a' in 5l/vl/...) *) 5 | let debug_gen = ref false 6 | 7 | (* ??? *) 8 | let kencc_compatible = ref true 9 | -------------------------------------------------------------------------------- /shell/Fn.ml: -------------------------------------------------------------------------------- 1 | (*s: shell/Fn.ml *) 2 | module R = Runtime 3 | 4 | (*s: function [[Fn.flook]] *) 5 | let flook s = 6 | try 7 | Some (Hashtbl.find R.fns s) 8 | with Not_found -> None 9 | (*e: function [[Fn.flook]] *) 10 | (*e: shell/Fn.ml *) 11 | -------------------------------------------------------------------------------- /generators/lex/Main.ml: -------------------------------------------------------------------------------- 1 | (*s: lex/Main.ml *) 2 | 3 | (*s: toplevel [[Main._1]] *) 4 | let _ = 5 | (* Deprecated in OCaml 5 cos done by default: Printexc.catch *) 6 | CLI.main (); 7 | exit 0 8 | (*e: toplevel [[Main._1]] *) 9 | (*e: lex/Main.ml *) 10 | -------------------------------------------------------------------------------- /generators/yacc/Slr.mli: -------------------------------------------------------------------------------- 1 | (*s: yacc/Slr.mli *) 2 | 3 | (*s: signature [[Slr.lr_tables]](yacc) *) 4 | val lr_tables: 5 | Lr0.env -> Lr0.automaton -> First_follow.follow -> Lrtables.lr_tables 6 | (*e: signature [[Slr.lr_tables]](yacc) *) 7 | (*e: yacc/Slr.mli *) 8 | -------------------------------------------------------------------------------- /kernel/concurrency/Counter.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | open Types 4 | 5 | type t = Ref.t 6 | 7 | let alloc (n : int) : t = 8 | Ref.alloc n 9 | 10 | (* will start at n+1 when n is the count given to alloc *) 11 | let gen (x : t) : int = 12 | Ref.inc x 13 | -------------------------------------------------------------------------------- /lib_graphics/input/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_graphics_input) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_geometry 9 | xix_draw 10 | ) 11 | (preprocess (pps ppx_deriving.show)) 12 | ) 13 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/geometry/point.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = { 3 | x: int; 4 | y: int; 5 | } 6 | 7 | val p: int -> int -> t 8 | 9 | val zero: t 10 | 11 | val add: t -> t -> t 12 | val sub: t -> t -> t 13 | val mul: t -> t -> t 14 | val div: t -> t -> t 15 | -------------------------------------------------------------------------------- /tests/compiler/parsing/todo/strings_unicode.c: -------------------------------------------------------------------------------- 1 | char* str = "foo" "bar"; 2 | 3 | //char* mix = L"foo" "bar"; 4 | 5 | void main() { 6 | unsigned int *mix; 7 | char *x; 8 | mix = L"foo"; 9 | 10 | x = "foo" "bar"; 11 | mix = L"foo" L"bar"; 12 | } 13 | -------------------------------------------------------------------------------- /tests/snapshots/xix/9a9f36d8103e/stdxxx: -------------------------------------------------------------------------------- 1 | 0: Pseudo( 2 | TEXT({name="foo"; priv=None; sig=None; }, {dupok=false; no_prof=false; }, 4)) 3 | 1: (MOVE(Word, None, Ximm(Address(Local(Some("x"), -4))), Imsr(Reg(R(0)))), AL) 4 | 2: Virtual(RET) 5 | 3: Virtual(RET) 6 | -------------------------------------------------------------------------------- /kernel/Libc/fmt/errfmt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "fmtdef.h" 4 | 5 | int 6 | errfmt(Fmt *f) 7 | { 8 | char buf[ERRMAX]; 9 | 10 | rerrstr(buf, sizeof buf); 11 | return _fmtcpy(f, buf, utflen(buf), strlen(buf)); 12 | } 13 | -------------------------------------------------------------------------------- /kernel/base/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_base) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_kernel_core 9 | xix_kernel_concurrency_ 10 | ) 11 | (preprocess (pps ppx_deriving.show)) 12 | ) 13 | -------------------------------------------------------------------------------- /kernel/time/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_time) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_kernel_base 9 | xix_kernel_scheduler 10 | ) 11 | (preprocess (pps ppx_deriving.show)) 12 | ) 13 | -------------------------------------------------------------------------------- /tests/compiler/codegen/address_local.c: -------------------------------------------------------------------------------- 1 | int** foo() { 2 | int *x; 3 | 4 | //&(&x); 5 | 6 | // 5a and ast_asm5.ml didnt support to get the address of 7 | // a local or parameter originally, but you need this 8 | // feature! 9 | return &x; 10 | } 11 | -------------------------------------------------------------------------------- /tests/compiler/extensions/unnamed.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | int x; 3 | int y; 4 | }; 5 | 6 | struct Bar { 7 | struct Foo; // anon structure element 8 | int z; 9 | }; 10 | 11 | int foo (struct Bar* x) { 12 | return x->x; // sugar for x->__Foo.x 13 | } 14 | -------------------------------------------------------------------------------- /tests/lex/lexer.mll: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | let space = [' ''\t'] 5 | 6 | rule token = parse 7 | | "foo" { after_foo 0 lexbuf } 8 | 9 | and after_foo myarg = parse 10 | | "bar" { after_foo (myarg + 1) lexbuf } 11 | | "foobar" { 2 } 12 | | "foox" { 3 } 13 | -------------------------------------------------------------------------------- /kernel/Port/portfns_misc.h: -------------------------------------------------------------------------------- 1 | 2 | // parse.c 3 | Cmdbuf* parsecmd(char *a, int n); 4 | Cmdtab* lookupcmd(Cmdbuf*, Cmdtab*, int); 5 | void cmderror(Cmdbuf*, char*); 6 | 7 | // random.c 8 | void randominit(void); 9 | ulong randomread(void*, ulong); 10 | 11 | -------------------------------------------------------------------------------- /kernel/concurrency/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_concurrency) 3 | (wrapped false) 4 | (libraries 5 | xix_commons 6 | xix_kernel_core 7 | xix_kernel_concurrency_ 8 | xix_kernel_base 9 | ) 10 | (preprocess (pps ppx_deriving.show)) 11 | ) 12 | -------------------------------------------------------------------------------- /kernel/memory/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_memory) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_kernel_base 9 | xix_kernel_concurrency 10 | ) 11 | (preprocess (pps ppx_deriving.show)) 12 | ) 13 | -------------------------------------------------------------------------------- /kernel/processes/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_processes) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_kernel_base 9 | xix_kernel_memory 10 | ) 11 | (preprocess (pps ppx_deriving.show)) 12 | ) 13 | -------------------------------------------------------------------------------- /kernel/time/Alarms.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = { 3 | (* sorted list by Proc_.alarm time *) 4 | mutable elts: Process.t list; 5 | 6 | ql: Qlock.t; 7 | } 8 | 9 | val alarms : t 10 | 11 | val add_proc : Process.t -> 'a -> unit 12 | val del_proc : Process.t -> unit 13 | -------------------------------------------------------------------------------- /kernel/time/Timers.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = { 3 | (* sorted by fasttk *) 4 | mutable elts: Timer.t list; 5 | 6 | (* !lock ordering! lock(Timer.t); lock(Timers.t) *) 7 | l: Ilock.t; 8 | } 9 | 10 | val cpus_timers : t array 11 | 12 | val add : Timer.t -> unit 13 | -------------------------------------------------------------------------------- /lib_core/commons/CapStdlib.ml: -------------------------------------------------------------------------------- 1 | (* TODO: deprecated, use Exit.exit now *) 2 | let exit (_caps : < Cap.exit; .. >) = exit 3 | 4 | (* TODO: deprecated, use FS.with_open_in now *) 5 | (* nosemgrep: do-not-use-open-in *) 6 | let open_in (_caps : < Cap.open_in; ..>) = open_in 7 | -------------------------------------------------------------------------------- /vcs/client_git.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/client_git.mli *) 2 | 3 | (*s: signature [[Client_git.mk_client]] *) 4 | val mk_client: string (* Fpath.t or Uri.t like git:// *) -> Client.t 5 | (*e: signature [[Client_git.mk_client]] *) 6 | (*e: version_control/client_git.mli *) 7 | -------------------------------------------------------------------------------- /kernel/scheduler/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel_scheduler) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_kernel_base 9 | xix_kernel_processes 10 | ) 11 | (preprocess (pps ppx_deriving.show)) 12 | ) 13 | -------------------------------------------------------------------------------- /lib_graphics/input/Cursor.mli: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | type t = { 4 | offset: Point.t; 5 | clr: byte array; 6 | set: byte array; 7 | } 8 | 9 | (* for Mouse.reset_cursor *) 10 | val arrow: t 11 | 12 | (* helpers *) 13 | val ints_to_bytes: int array -> byte array 14 | -------------------------------------------------------------------------------- /utilities/text/ed/Token.ml: -------------------------------------------------------------------------------- 1 | type t = 2 | | Spaces 3 | | Newline 4 | | EOF 5 | 6 | (* letter or '=' *) 7 | | Char of char 8 | | Int of int 9 | | String of string 10 | 11 | | Comma 12 | (* TODO: TPlus, TMinus, TPlusPlus, ... *) 13 | [@@deriving show] 14 | -------------------------------------------------------------------------------- /lib_graphics/ui/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_graphics_ui) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | xix_commons 8 | xix_geometry 9 | xix_graphics_input 10 | ; xix_draw 11 | ) 12 | (preprocess (pps ppx_deriving.show)) 13 | ) 14 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/input/cursor.mli: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | type t = { 4 | offset: Point.t; 5 | clr: byte array; 6 | set: byte array; 7 | } 8 | 9 | (* for Mouse.reset_cursor *) 10 | val arrow: t 11 | 12 | (* helpers *) 13 | val ints_to_bytes: int array -> byte array 14 | -------------------------------------------------------------------------------- /generators/lex/pad.txt: -------------------------------------------------------------------------------- 1 | Originally imported from ocaml-light/lex and must be kept in sync. 2 | The literate document is in plan9/generators/CompilerGenerator.nw. 3 | This literate document is using syncweb https://github.com/aryx/syncweb 4 | hence the presence of those .md5sum_xxx files. 5 | -------------------------------------------------------------------------------- /kernel/Libc/fmt/fprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | fprint(int fd, char *fmt, ...) 6 | { 7 | int n; 8 | va_list args; 9 | 10 | va_start(args, fmt); 11 | n = vfprint(fd, fmt, args); 12 | va_end(args); 13 | return n; 14 | } 15 | -------------------------------------------------------------------------------- /scripts/remove_xix_open.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is used via some 'ocamlc -pp remove_xix_open.sh' in bootstrap-mk.sh 4 | # and a few mkfiles so we can compile xix with ocaml-light which does not know 5 | # about (wrapped true) dune generated modules. 6 | 7 | sed '/^open Xix_/d' "$1" 8 | -------------------------------------------------------------------------------- /tests/snapshots/xix/950c2b43e47d/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 0))) 4 | 1: (Instr (Move2 (W__, (Right (Int 42)), (Gen (GReg (R 1)))))) 5 | 2: (Virtual RET) 6 | 3: (Virtual RET) 7 | -------------------------------------------------------------------------------- /tests/snapshots/xix/e38254f497ad/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 0))) 4 | 1: (Instr (Move2 (W__, (Right (Int 42)), (Gen (GReg (R 8)))))) 5 | 2: (Virtual RET) 6 | 3: (Virtual RET) 7 | -------------------------------------------------------------------------------- /kernel/concurrency/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES= -I ../core -I ../concurrency_/ -I $TOP/lib_core/commons -I ../base 5 | SRC= Tas.ml \ 6 | Spl.ml Ilock.ml Spinlock.ml Qlock.ml Ref.ml \ 7 | Counter.ml Rwlock.ml 8 | 9 | <$TOP/mkconfig 10 | <$TOP/mkfiles/mklib 11 | -------------------------------------------------------------------------------- /lib_core/regexps/re/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_re) 3 | ; testo is using itself ocaml-re so to avoid 4 | ; conflict better to wrap it in Xix_re to avoid conflicts 5 | ;(wrapped false) 6 | (libraries 7 | xix_commons 8 | ) 9 | (preprocess (pps ppx_deriving.show)) 10 | ) 11 | -------------------------------------------------------------------------------- /tests/assembler/exit_linux_riscv.s: -------------------------------------------------------------------------------- 1 | TEXT _start+0(SB), $0 2 | 3 | // RISC-V: a0 = arg0, a7 = syscall number 4 | MOVW $42, R0 // exit code 5 | MOVW $93, R7 // syscall number = exit (93) 6 | ECALL // trap to kernel 7 | RET // not reached 8 | -------------------------------------------------------------------------------- /lib_graphics/mkfile: -------------------------------------------------------------------------------- 1 | DIRS= geometry draw input ui 2 | 3 | all:V: all.directories 4 | opt:V: opt.directories 5 | clean:V: clean.directories 6 | depend:V: depend.directories 7 | 8 | %.directories:V: 9 | for(i in $DIRS) @{ 10 | echo $i/ 11 | cd $i 12 | mk $MKFLAGS $stem 13 | } 14 | 15 | -------------------------------------------------------------------------------- /linker/Rewritev.mli: -------------------------------------------------------------------------------- 1 | 2 | (* Mostly TEXT/RET rewrite depending whether a function is a "leaf". 3 | * !!actually works by side effect on graph so take care!! 4 | * may raise Failure in case of error. 5 | *) 6 | val rewrite: 7 | Ast_asmv.instr Types.code_graph -> Ast_asmv.instr Types.code_graph 8 | -------------------------------------------------------------------------------- /tests/yacc/arith.mly: -------------------------------------------------------------------------------- 1 | %{ 2 | %} 3 | 4 | %token PLUS MULT TOPAR TCPAR 5 | %token ID 6 | 7 | %start e 8 | 9 | %% 10 | 11 | e: e PLUS t { } 12 | | t { } 13 | ; 14 | 15 | t: t MULT f { } 16 | | f { } 17 | ; 18 | 19 | f: TOPAR e TCPAR { } 20 | | ID { } 21 | ; 22 | 23 | 24 | -------------------------------------------------------------------------------- /kernel/scheduler/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES= -I ../core -I ../concurrency_/ -I ../base -I ../concurrency -I ../memory -I ../processes -I $TOP/lib_core/commons -I +threads 5 | SRC= Rendez.ml Hz_sched.ml Scheduler.ml 6 | 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /windows/Thread_keyboard.mli: -------------------------------------------------------------------------------- 1 | (*s: Thread_keyboard.mli *) 2 | 3 | (*s: signature [[Thread_keyboard.thread]] *) 4 | (* Reads from the keyboard and sends the key to the "current" window *) 5 | val thread: Keyboard.ctl -> unit 6 | (*e: signature [[Thread_keyboard.thread]] *) 7 | (*e: Thread_keyboard.mli *) 8 | -------------------------------------------------------------------------------- /kernel/Libc/port/strdup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char* 5 | strdup(char *s) 6 | { 7 | char *ns; 8 | 9 | ns = malloc(strlen(s) + 1); 10 | if(ns == 0) 11 | return 0; 12 | setmalloctag(ns, getcallerpc(&s)); 13 | 14 | return strcpy(ns, s); 15 | } 16 | -------------------------------------------------------------------------------- /lib_core/regexps/re/tests/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_re_tests) 3 | (wrapped false) 4 | (libraries 5 | xix_re 6 | testo ounit2 7 | xix_commons 8 | ) 9 | (flags (:standard -w -14)) ; for illegal backslash but does not seem to work :( 10 | (preprocess (pps ppx_deriving.show)) 11 | ) 12 | -------------------------------------------------------------------------------- /lib_core/regexps/str/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../../.. 4 | INCLUDES=-I . 5 | 6 | #alt: merge with lib_core/strings/ but str.ml relies on C lib -lstr 7 | # so simpler to separate it like it's separated in the original stdlib 8 | SRC=Str.ml 9 | 10 | <$TOP/mkconfig 11 | <$TOP/mkfiles/mklib 12 | -------------------------------------------------------------------------------- /linker/Check.mli: -------------------------------------------------------------------------------- 1 | (*s: Check.mli *) 2 | 3 | (*s: signature [[Check.check]] *) 4 | (* Make sure there is no reference to undefined symbols. 5 | * raise Failure in case of error. 6 | *) 7 | val check: 8 | Types.symbol_table -> unit 9 | (*e: signature [[Check.check]] *) 10 | (*e: Check.mli *) 11 | -------------------------------------------------------------------------------- /tests/compiler/scoping/typedef_scope.c: -------------------------------------------------------------------------------- 1 | 2 | typedef int foo; 3 | 4 | void bar() { 5 | foo foo; 6 | 7 | { 8 | //typedef int foo; // forbidden cos not at toplevel for now 9 | return foo; 10 | } 11 | 12 | return foo; 13 | } 14 | // this would generate an error. 15 | //return foo; 16 | -------------------------------------------------------------------------------- /debugger/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=.. 4 | INCLUDES=-I $TOP/lib_core/commons 5 | 6 | SRC= ksym.ml 7 | 8 | SYSLIBS=str.cma 9 | LIBS=$TOP/lib_core/commons/lib.cma 10 | 11 | # or use Principia spirit! THE assembler! so call it simply 'assembler' ? :) 12 | PROG=ksym 13 | 14 | <$TOP/mkfiles/mkprog 15 | -------------------------------------------------------------------------------- /kernel/Libc/fmt/snprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | snprint(char *buf, int len, char *fmt, ...) 6 | { 7 | int n; 8 | va_list args; 9 | 10 | va_start(args, fmt); 11 | n = vsnprint(buf, len, fmt, args); 12 | va_end(args); 13 | return n; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/mkfile: -------------------------------------------------------------------------------- 1 | DIRS= geometry input 2 | # draw input 3 | 4 | all:V: all.directories 5 | opt:V: opt.directories 6 | clean:V: clean.directories 7 | depend:V: depend.directories 8 | 9 | %.directories:V: 10 | for(i in $DIRS) @{ 11 | echo $i/ 12 | cd $i 13 | mk $MKFLAGS $stem 14 | } 15 | -------------------------------------------------------------------------------- /generators/yacc/Output.mli: -------------------------------------------------------------------------------- 1 | (*s: yacc/Output.mli *) 2 | 3 | (*s: signature [[Output.output_parser]](yacc) *) 4 | val output_parser: 5 | Ast.parser_definition -> Lr0.env -> Lrtables.lr_tables -> 6 | in_channel -> out_channel -> unit 7 | (*e: signature [[Output.output_parser]](yacc) *) 8 | (*e: yacc/Output.mli *) 9 | -------------------------------------------------------------------------------- /kernel/processes/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES= -I ../core -I ../concurrency_/ -I ../base -I ../concurrency -I ../memory -I $TOP/lib_core/commons -I +threads 5 | SRC= Process.ml Kproc.ml \ 6 | sysexec.ml sysrfork.ml sysexits.ml 7 | 8 | 9 | <$TOP/mkconfig 10 | <$TOP/mkfiles/mklib 11 | -------------------------------------------------------------------------------- /lib_core/system/unix/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../../.. 4 | INCLUDES=-I . 5 | 6 | #alt: merge with lib_core/system/ but unix.ml relies on C lib -lunix 7 | # so simpler to separate it like it's separated in the original stdlib 8 | SRC=\ 9 | Unix.ml 10 | 11 | <$TOP/mkconfig 12 | <$TOP/mkfiles/mklib 13 | -------------------------------------------------------------------------------- /linker/TOPORT/ld/elf.h: -------------------------------------------------------------------------------- 1 | enum { 2 | Ehdr64sz = 64, 3 | Phdr64sz = 56, 4 | Shdr64sz = 64, 5 | }; 6 | 7 | enum { 8 | /* Shdr Codes */ 9 | Progbits = 1, /* section types */ 10 | Strtab = 3, 11 | Nobits = 8, 12 | 13 | Swrite = 1, /* section attributes (flags) */ 14 | Salloc = 2, 15 | Sexec = 4, 16 | }; 17 | -------------------------------------------------------------------------------- /tests/compiler/checking/global_redeclare.c: -------------------------------------------------------------------------------- 1 | 2 | int foo; 3 | // useless redeclaration 4 | //int foo; 5 | 6 | // this is ok, you give more precision, the previous one could have been 7 | // a forward decl 8 | int foo = 1; 9 | 10 | // 5c does not say anything, hmmm, at least clang warns 11 | int foo = 2; 12 | -------------------------------------------------------------------------------- /kernel/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name xix_kernel) 3 | (wrapped false) 4 | (libraries 5 | stdcompat 6 | threads 7 | 8 | xix_commons 9 | 10 | xix_kernel_base 11 | xix_kernel_memory 12 | xix_kernel_processes 13 | xix_kernel_time 14 | ) 15 | (preprocess (pps ppx_deriving.show)) 16 | ) 17 | -------------------------------------------------------------------------------- /shell/Lexer.mli: -------------------------------------------------------------------------------- 1 | (*s: Lexer.mli *) 2 | (*s: signature [[Lexer.token]] *) 3 | val token: Lexing.lexbuf -> Parser.token 4 | (*e: signature [[Lexer.token]] *) 5 | 6 | (*s: exception [[Lexer.Lexical_error]] *) 7 | exception Lexical_error of string 8 | (*e: exception [[Lexer.Lexical_error]] *) 9 | (*e: Lexer.mli *) 10 | -------------------------------------------------------------------------------- /assembler/objects/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES=-I $TOP/lib_core/commons -I $TOP/macroprocessor 5 | 6 | SRC=Ast_asm.ml \ 7 | Ast_asm5.ml Meta_ast_asm5.ml \ 8 | Ast_asmv.ml \ 9 | Ast_asmi.ml \ 10 | Object_file.ml \ 11 | Arch_linker.ml 12 | 13 | <$TOP/mkconfig 14 | <$TOP/mkfiles/mklib 15 | -------------------------------------------------------------------------------- /kernel/Libc/port/toupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | toupper(int c) 5 | { 6 | 7 | if(c < 'a' || c > 'z') 8 | return c; 9 | return _toupper(c); 10 | } 11 | 12 | int 13 | tolower(int c) 14 | { 15 | 16 | if(c < 'A' || c > 'Z') 17 | return c; 18 | return _tolower(c); 19 | } 20 | -------------------------------------------------------------------------------- /lib_graphics/ui/Menu_ui.mli: -------------------------------------------------------------------------------- 1 | 2 | type item = (string * (unit -> unit)) 3 | type items = item list 4 | 5 | val menu: 6 | items -> 7 | Point.t (* position of menu *) -> 8 | Mouse.button (* which button release to look for*) -> 9 | Mouse.ctl -> (Display.t * Baselayer.t * Image.t * Font.t) -> 10 | unit 11 | 12 | -------------------------------------------------------------------------------- /tests/compiler/xexit_arm.s: -------------------------------------------------------------------------------- 1 | // xexit_arm.s — Linux ARM32 exit(0) using Plan 9 5a syntax 2 | 3 | TEXT xexit+0(SB), $0 4 | MOVW $0, R0 // status = 0 (argument) 5 | MOVW $1, R7 // syscall number 1 = sys_exit 6 | SWI $0 // trap into kernel 7 | RET // never reached 8 | -------------------------------------------------------------------------------- /tests/snapshots/xix/35f100ebdd98/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 4))) 4 | 1: (Instr 5 | (Move2 (W__, (Right (Address (Local ((Some "x"), -4)))), 6 | (Gen (GReg (R 8)))))) 7 | 2: (Virtual RET) 8 | 3: (Virtual RET) 9 | -------------------------------------------------------------------------------- /tests/snapshots/xix/683a109b63ed/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 4))) 4 | 1: (Instr 5 | (Move2 (W__, (Right (Address (Local ((Some "x"), -4)))), 6 | (Gen (GReg (R 1)))))) 7 | 2: (Virtual RET) 8 | 3: (Virtual RET) 9 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/mkfile: -------------------------------------------------------------------------------- 1 | TOP=../../.. 2 | 3 | INCLUDES=-I $TOP/lib_core/commons -I ../geometry 4 | 5 | SRC= channel.ml color.ml \ 6 | image.ml display.ml \ 7 | draw_graphics.ml draw.ml \ 8 | line.ml polygon.ml ellipse.ml arc.ml \ 9 | font.ml text.ml \ 10 | 11 | <$TOP/mkconfig 12 | <$TOP/mklib 13 | -------------------------------------------------------------------------------- /regressions.txt: -------------------------------------------------------------------------------- 1 | # -*- org -*- 2 | 3 | * when exit from rio-ocaml, the terminal does not work very well 4 | same with rio-c? general pb of closedisplay with or without 5 | shutdown that does not close everything? 6 | 7 | * hellorio in ocaml and rio in ocaml sometimes get a suicide trap. 8 | Not sure why. pb about reading addr 0x5 9 | -------------------------------------------------------------------------------- /tests/snapshots/xix/4eac33d61e2d/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 0))) 4 | 1: (Instr 5 | (Move2 (W__, (Left (Gen (Entity (Param ((Some "x"), 0))))), 6 | (Gen (GReg (R 8)))))) 7 | 2: (Virtual RET) 8 | 3: (Virtual RET) 9 | -------------------------------------------------------------------------------- /tests/snapshots/xix/c28b806da432/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 0))) 4 | 1: (Instr 5 | (Move2 (W__, (Left (Gen (Entity (Param ((Some "x"), 0))))), 6 | (Gen (GReg (R 1)))))) 7 | 2: (Virtual RET) 8 | 3: (Virtual RET) 9 | -------------------------------------------------------------------------------- /utilities/text/ed/dune: -------------------------------------------------------------------------------- 1 | (executable 2 | (name Main) 3 | (libraries 4 | str unix 5 | xix_commons 6 | ) 7 | (preprocess (pps ppx_deriving.show)) 8 | (modes native byte) 9 | ) 10 | 11 | (ocamllex Lexer) 12 | 13 | (install 14 | (package xix) 15 | (section bin) 16 | (files 17 | (Main.exe as oed) 18 | ) 19 | ) 20 | -------------------------------------------------------------------------------- /vcs/diff_unified.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/diff_unified.mli *) 2 | 3 | (*s: signature [[Diff_unified.show_change]] *) 4 | val show_change: Change.t -> unit 5 | (*e: signature [[Diff_unified.show_change]] *) 6 | 7 | (* internals *) 8 | val show_unified_diff: Diff.diff -> unit 9 | (*e: version_control/diff_unified.mli *) 10 | -------------------------------------------------------------------------------- /vcs/dump.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/dump.mli *) 2 | 3 | (*s: signature [[Dump.vof_obj]] *) 4 | val vof_obj: Objects.t -> OCaml.v 5 | (*e: signature [[Dump.vof_obj]] *) 6 | (*s: signature [[Dump.vof_index]] *) 7 | val vof_index: Index.t -> OCaml.v 8 | (*e: signature [[Dump.vof_index]] *) 9 | (*e: version_control/dump.mli *) 10 | -------------------------------------------------------------------------------- /windows/Virtual_mouse.mli: -------------------------------------------------------------------------------- 1 | (*s: Virtual_mouse.mli *) 2 | 3 | (*s: signature [[Virtual_mouse.dev_mouse]] *) 4 | (* a virtual "/dev/mouse" *) 5 | val dev_mouse: Device.t 6 | (*e: signature [[Virtual_mouse.dev_mouse]] *) 7 | 8 | (* a virtual "/dev/cursor" *) 9 | (* val dev_cursor: Device.t *) 10 | (*e: Virtual_mouse.mli *) 11 | -------------------------------------------------------------------------------- /kernel/Old/mkfile: -------------------------------------------------------------------------------- 1 | LOADADDR=0x80008000 2 | 3 | LD=5l 4 | AS=5a 5 | CC=5c 6 | 7 | OBJ=start.5 8 | 9 | %.5: %.s 10 | $AS $prereq 11 | 12 | %.5: %.c 13 | $CC $prereq 14 | 15 | kernel: $OBJ $LIB 16 | $LD -f -o $target -H6 -R4096 -T$LOADADDR -l $OBJ $LIB 17 | 18 | 19 | run:VI: 20 | qemu-system-arm -M raspi2 -bios kernel 21 | -------------------------------------------------------------------------------- /kernel/memory/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES= -I ../core -I ../concurrency_/ -I ../base -I ../concurrency -I $TOP/lib_core/commons 5 | SRC= Kernel_memory.ml User_memory.ml \ 6 | Page.ml Pagetable.ml \ 7 | Proc_segment.ml Segment.ml \ 8 | sysbrk.ml 9 | 10 | <$TOP/mkconfig 11 | <$TOP/mkfiles/mklib 12 | -------------------------------------------------------------------------------- /shell/Pattern.mli: -------------------------------------------------------------------------------- 1 | (*s: Pattern.mli *) 2 | (* todo: Glob char *) 3 | (*s: type [[Pattern.pattern]] *) 4 | type pattern = string 5 | (*e: type [[Pattern.pattern]] *) 6 | 7 | (*s: signature [[Pattern.match_str]] *) 8 | val match_str : string -> pattern -> bool 9 | (*e: signature [[Pattern.match_str]] *) 10 | (*e: Pattern.mli *) 11 | -------------------------------------------------------------------------------- /lib_core/profiling/dune: -------------------------------------------------------------------------------- 1 | ; used to be in pfff in commons/Common.ml 2 | ; and then in semgrep/libs/profiling/ 3 | 4 | (library 5 | ;(public_name profiling) 6 | (name xix_profiling) 7 | (wrapped false) 8 | (libraries 9 | unix 10 | xix_commons 11 | ;process_limits ; for Time_limit.Timeout special handling 12 | ) 13 | ) 14 | -------------------------------------------------------------------------------- /lib_core/system/plan9/errstr.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "plan9support.h" 4 | 5 | #include 6 | 7 | value plan9_errstr(value str, value len) /* ML */ 8 | { 9 | int ret; 10 | ret = errstr(String_val(str), Int_val(len)); 11 | if (ret != 0) p9error("errstr"); 12 | return Val_unit; 13 | } 14 | -------------------------------------------------------------------------------- /lib_graphics/draw/Draw_marshal.mli: -------------------------------------------------------------------------------- 1 | 2 | val bp_bool: bool -> string 3 | 4 | val bp_byte: int -> string 5 | val bp_short: int -> string 6 | val bp_long: int -> string 7 | 8 | 9 | val bp_point: Point.t -> string 10 | val bp_rect: Rectangle.t -> string 11 | 12 | val bp_chans: Channel.t -> string 13 | val bp_color: Color.t -> string 14 | -------------------------------------------------------------------------------- /tests/assembler/exit_linux_mips.s: -------------------------------------------------------------------------------- 1 | // Registers in Plan 9 syntax correspond roughly as: 2 | // R1 → $at 3 | // R2 → $v0 4 | // R3–R10 → $a0–$a7 5 | 6 | TEXT _start+0(SB), $0 7 | 8 | MOVW $42, R4 // a0 = exit code 9 | MOVW $4001, R2 // v0 = syscall number (exit) 10 | SYSCALL 11 | RET // not reached 12 | -------------------------------------------------------------------------------- /vcs/diffs.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/diffs.mli *) 2 | 3 | (*s: signature [[Diffs.diff]] *) 4 | val diff: string -> string -> Diff.diff 5 | (*e: signature [[Diffs.diff]] *) 6 | 7 | (* the split lines contain the trailing '\n' when they have one *) 8 | val split_lines: string -> string list 9 | 10 | (*e: version_control/diffs.mli *) 11 | -------------------------------------------------------------------------------- /kernel/Libc/arm/vlop.s: -------------------------------------------------------------------------------- 1 | TEXT _mulv(SB), 1, $0 2 | MOVW 4(FP),R8 /* l0 */ 3 | MOVW 8(FP),R11 /* h0 */ 4 | MOVW 12(FP),R4 /* l1 */ 5 | MOVW 16(FP),R5 /* h1 */ 6 | MULLU R8,R4,(R6, R7) /* l0*l1 */ 7 | MUL R8,R5,R5 /* l0*h1 */ 8 | MUL R11,R4,R4 /* h0*l1 */ 9 | ADD R4,R6 10 | ADD R5,R6 11 | MOVW R6,4(R0) 12 | MOVW R7,0(R0) 13 | RET 14 | -------------------------------------------------------------------------------- /kernel/Libc/fmt/sprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | sprint(char *buf, char *fmt, ...) 6 | { 7 | int n; 8 | va_list args; 9 | 10 | va_start(args, fmt); 11 | n = vsnprint(buf, 65536, fmt, args); /* big number, but sprint is deprecated anyway */ 12 | va_end(args); 13 | return n; 14 | } 15 | -------------------------------------------------------------------------------- /lib_graphics/input/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | #TODO: should use -I +threads instead of full path below 5 | INCLUDES=-I $TOP/lib_core/commons -I $TOP/lib_graphics/draw -I $TOP/lib_graphics/geometry -I +threads -I /usr/local/lib/ocaml/ 6 | SRC= Cursor.ml Mouse.ml Keyboard.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | -------------------------------------------------------------------------------- /shell/Pattern.ml: -------------------------------------------------------------------------------- 1 | (*s: shell/Pattern.ml *) 2 | 3 | (*s: type [[Pattern.pattern]] *) 4 | type pattern = string 5 | (*e: type [[Pattern.pattern]] *) 6 | 7 | (*s: function [[Pattern.match_str]] *) 8 | (* todo: handle [ * ? *) 9 | let match_str s1 s2 = 10 | s1 = s2 11 | (*e: function [[Pattern.match_str]] *) 12 | (*e: shell/Pattern.ml *) 13 | -------------------------------------------------------------------------------- /tests/compiler/checking/storage_adjust.c: -------------------------------------------------------------------------------- 1 | extern int x; 2 | int x = 1; 3 | 4 | extern int y; 5 | int y; 6 | 7 | 8 | int z; 9 | extern int z; // should warn 10 | 11 | extern int w = 1; // should warn 12 | 13 | // always trigger an error message at the toplevel 14 | auto int a; 15 | 16 | static int s; 17 | int s; 18 | extern int s; 19 | -------------------------------------------------------------------------------- /tests/compiler/typing/voidstar.c: -------------------------------------------------------------------------------- 1 | int *x; 2 | // 5c allows this (with -V or without), because pointer at the top of the type 3 | // clang does not 4 | void *x = (void*)0; 5 | 6 | // but not this if you use 5c -V, because pointer is not at the top 7 | // of the type (but inside a TFUNC) 8 | int foo(int *x); 9 | 10 | int foo(void *x); 11 | -------------------------------------------------------------------------------- /windows/Threads_fileserver.mli: -------------------------------------------------------------------------------- 1 | (*s: Threads_fileserver.mli *) 2 | 3 | (*s: signature [[Threads_fileserver.thread]] *) 4 | (* 5 | will serve all the virtual devices for new windows/processes created by rio. 6 | *) 7 | val thread: Fileserver.t -> unit 8 | (*e: signature [[Threads_fileserver.thread]] *) 9 | (*e: Threads_fileserver.mli *) 10 | -------------------------------------------------------------------------------- /compiler/Error.mli: -------------------------------------------------------------------------------- 1 | (*s: Error.mli *) 2 | 3 | (*s: signature [[Error.warn]] *) 4 | val warn: string -> Location_cpp.loc -> unit 5 | (*e: signature [[Error.warn]] *) 6 | 7 | (*s: signature [[Error.errorexit]] *) 8 | (* this raises Exit.ExitCode 1 *) 9 | val errorexit: string -> 'a 10 | (*e: signature [[Error.errorexit]] *) 11 | (*e: Error.mli *) 12 | -------------------------------------------------------------------------------- /linker/Datagen.mli: -------------------------------------------------------------------------------- 1 | (*s: Datagen.mli *) 2 | 3 | (*s: signature [[Datagen.gen]] *) 4 | (* uses only sizes.data_size *) 5 | val gen: 6 | Types.symbol_table2 -> Types.addr (* init_data *) -> 7 | Exec_file.sections_size -> Endian.t -> 8 | Types.data list -> 9 | Types.byte array 10 | (*e: signature [[Datagen.gen]] *) 11 | (*e: Datagen.mli *) 12 | -------------------------------------------------------------------------------- /tests/linker/world.s: -------------------------------------------------------------------------------- 1 | TEXT exit(SB), $4 2 | /* prepare the system call EXITS(0) */ 3 | MOVW $0, R1 4 | MOVW R1, 4(R13) 5 | MOVW $3 /*EXITS*/, R0 6 | /* system call */ 7 | SWI $0 8 | RET /* not reached */ 9 | 10 | 11 | GLOBL hello(SB), $12 12 | DATA hello+0(SB)/6, $"Hello " 13 | 14 | -------------------------------------------------------------------------------- /windows/Threads_window.mli: -------------------------------------------------------------------------------- 1 | (*s: Threads_window.mli *) 2 | 3 | (*s: signature [[Threads_window.thread]] *) 4 | (* Thread listening to keyboard/mouse/wm events for a particular window 5 | * and dispatching to the right channel. 6 | *) 7 | val thread: Window.t -> unit 8 | (*e: signature [[Threads_window.thread]] *) 9 | (*e: Threads_window.mli *) 10 | -------------------------------------------------------------------------------- /assembler/TOPORT/6a/a.h: -------------------------------------------------------------------------------- 1 | typedef struct Ref Ref; 2 | typedef struct Gen2 Gen2; 3 | 4 | struct Sym 5 | { 6 | Ref* ref; 7 | vlong value; 8 | }; 9 | 10 | struct Ref 11 | { 12 | int class; 13 | }; 14 | 15 | struct Gen 16 | { 17 | vlong offset; 18 | short index; 19 | short scale; 20 | }; 21 | struct Gen2 22 | { 23 | Gen from; 24 | Gen to; 25 | }; 26 | -------------------------------------------------------------------------------- /compiler/Dumper_.mli: -------------------------------------------------------------------------------- 1 | (*s: Dumper_.mli *) 2 | 3 | (*s: signature [[Dumper_.s_of_any]] *) 4 | val s_of_any: Ast.any -> string 5 | (*e: signature [[Dumper_.s_of_any]] *) 6 | 7 | (*s: signature [[Dumper_.s_of_any_with_types]] *) 8 | val s_of_any_with_types: Ast.any -> string 9 | (*e: signature [[Dumper_.s_of_any_with_types]] *) 10 | (*e: Dumper_.mli *) 11 | -------------------------------------------------------------------------------- /generators/yacc/Main.ml: -------------------------------------------------------------------------------- 1 | (*s: yacc/Main.ml *) 2 | 3 | (*s: toplevel [[Main._1]](yacc) *) 4 | let _ = 5 | (* 6 | Tests.test_lr0 (); 7 | Tests.test_first_follow (); 8 | Tests.test_slr (); 9 | Tests.test_lr_engine (); 10 | *) 11 | (*Printexc.catch*) CLI.main (); 12 | exit 0 13 | (*e: toplevel [[Main._1]](yacc) *) 14 | (*e: yacc/Main.ml *) 15 | -------------------------------------------------------------------------------- /kernel/Bcm/dat_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Time. 3 | * 4 | * HZ should divide 1000 evenly, ideally. 5 | * 100, 125, 200, 250 and 333 are okay. 6 | */ 7 | //#define Arch_HZ 100 /* clock frequency */ 8 | //to test things: 9 | #define Arch_HZ 1 /* clock frequency */ 10 | 11 | 12 | // was vlong in x86 13 | //typedef uvlong Tval; 14 | -------------------------------------------------------------------------------- /kernel/Old/mem.h: -------------------------------------------------------------------------------- 1 | #define KiB 1024u /* Kibi 0x0000000000000400 */ 2 | #define MiB 1048576u /* Mebi 0x0000000000100000 */ 3 | #define GiB 1073741824u /* Gibi 000000000040000000 */ 4 | 5 | #define KZERO 0x80000000 6 | 7 | #define BY2PG (4*KiB) 8 | 9 | #define CPUADDR (KZERO+0x2000) 10 | #define CPUSIZE BY2PG 11 | -------------------------------------------------------------------------------- /tests/compiler/checking/redeclaration.c: -------------------------------------------------------------------------------- 1 | int x; 2 | int x; 3 | 4 | int foo(int x, int x) { 5 | return x; 6 | } 7 | 8 | int bar() { 9 | int x; 10 | int x; 11 | return x; 12 | } 13 | 14 | struct X { 15 | int x; 16 | }; 17 | 18 | struct X { 19 | int y; 20 | }; 21 | 22 | 23 | struct Y { 24 | struct Y { 25 | int z; 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /tests/compiler/typing/switch.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | int *x; 3 | 4 | // switch.c:5 incompatible types: "INT" and "IND INT" for op "SUB" 5 | // quite cryptic, but because 5c transform this in 6 | // switch(0 - (0 - x)), but that way we forbid pointers or 7 | // struct or whatever as argument to the switch. 8 | switch(x) { 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /assembler/TOPORT/8a/a.h: -------------------------------------------------------------------------------- 1 | typedef struct Ref Ref; 2 | typedef struct Gen2 Gen2; 3 | 4 | struct Sym 5 | { 6 | Ref* ref; 7 | }; 8 | 9 | struct Ref 10 | { 11 | int class; 12 | }; 13 | 14 | struct Gen 15 | { 16 | int32 offset; 17 | int32 offset2; 18 | short index; 19 | short scale; 20 | }; 21 | struct Gen2 22 | { 23 | Gen from; 24 | Gen to; 25 | }; 26 | -------------------------------------------------------------------------------- /lib_core/commons/OS.ml: -------------------------------------------------------------------------------- 1 | 2 | (* supported OSes by xix toolchain *) 3 | type t = 4 | (* the big ones *) 5 | | Linux 6 | | Windows 7 | | MacOS 8 | (* the educational ones *) 9 | | Plan9 10 | | Xv6 11 | 12 | (* Note that many functions in the Sys module should work across OSes. 13 | * See also lib_system/{unix,plan9} os-specific libs. 14 | *) 15 | -------------------------------------------------------------------------------- /lib_core/system/plan9/bind.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "plan9support.h" 4 | 5 | #include 6 | 7 | value plan9_bind(value src, value dst, value flags) /* ML */ 8 | { 9 | int ret; 10 | ret = bind(String_val(src), String_val(dst), Int_val(flags)); 11 | if (ret < 0) p9error("bind"); 12 | return Val_int(ret); 13 | } 14 | -------------------------------------------------------------------------------- /kernel/Libmemdraw/hooks.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int 7 | hwdraw_OVERRIDEN(Memdrawparam*) 8 | { 9 | return 0; /* could not satisfy request */ 10 | } 11 | 12 | int 13 | memdraw_iprint(char*,...) 14 | { 15 | return -1; 16 | } 17 | 18 | int (*iprint)(char*, ...) = &memdraw_iprint; 19 | 20 | -------------------------------------------------------------------------------- /shell/Error.mli: -------------------------------------------------------------------------------- 1 | (*s: Error.mli *) 2 | (*s: signature [[Error.error]] *) 3 | (* Will behave like a 'raise'. Will Return until you reach 4 | * the interactive thread and set the status to the error argument. 5 | * Mostly used by the builtins. 6 | *) 7 | val error : < Cap.exit ; .. > -> string -> unit 8 | (*e: signature [[Error.error]] *) 9 | (*e: Error.mli *) 10 | -------------------------------------------------------------------------------- /tests/snapshots/xix/dbae373ebb9e/stdxxx: -------------------------------------------------------------------------------- 1 | 0: Pseudo( 2 | TEXT({name="foo"; priv=None; sig=None; }, {dupok=false; no_prof=false; }, 4)) 3 | 1: (MOVE(Word, None, Entity(Local(Some("x"), -4)), Imsr(Reg(R(0)))), AL) 4 | 2: (MOVE(Word, None, Imsr(Imm(1)), Imsr(Reg(R(1)))), AL) 5 | 3: (Arith(ADD, None, Reg(R(1)), None, R(0)), AL) 6 | 4: Virtual(RET) 7 | 5: Virtual(RET) 8 | -------------------------------------------------------------------------------- /kernel/Libc/port/memccpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void* 5 | memccpy(void *a1, void *a2, int c, ulong n) 6 | { 7 | uchar *s1, *s2; 8 | 9 | s1 = a1; 10 | s2 = a2; 11 | c &= 0xFF; 12 | while(n > 0) { 13 | if((*s1++ = *s2++) == c) 14 | return s1; 15 | n--; 16 | } 17 | return nil; 18 | } 19 | -------------------------------------------------------------------------------- /kernel/Libc/port/strchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char* 5 | strchr(char *s, int c) 6 | { 7 | char c0 = c; 8 | char c1; 9 | 10 | if(c == 0) { 11 | while(*s++) 12 | ; 13 | return s-1; 14 | } 15 | 16 | while(c1 = *s++) 17 | if(c1 == c0) 18 | return s-1; 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /kernel/base/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES= -I ../core -I ../concurrency_/ -I $TOP/lib_core/commons -I +threads 5 | SRC= Chan_.ml Device_.ml \ 6 | Hooks.ml \ 7 | Memory.ml Page_.ml Pagetable_.ml Segment_.ml \ 8 | Timer_.ml \ 9 | Process_.ml Cpu.ml \ 10 | Syscall.ml \ 11 | Globals.ml 12 | 13 | <$TOP/mkconfig 14 | <$TOP/mkfiles/mklib 15 | -------------------------------------------------------------------------------- /lib_parsing/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=.. 3 | 4 | # We could have lexing.ml and parsing.ml. It would work with ocamlc, 5 | # but not with ocamlopt :( 6 | 7 | INCLUDES=-I $TOP/lib_core/commons 8 | 9 | # Note that those files are sync'ed by syncweb from principia/generators 10 | 11 | SRC=Lexing_.ml Parsing_.ml 12 | 13 | <$TOP/mkconfig 14 | <$TOP/mkfiles/mklib 15 | -------------------------------------------------------------------------------- /tests/assembler/exit_linux_arm.s: -------------------------------------------------------------------------------- 1 | // ------------------------------------------- 2 | // main procedure 3 | // ------------------------------------------- 4 | 5 | TEXT _start+0(SB), $20 6 | 7 | MOVW $42, R0 /* exit code */ 8 | MOVW $1 , R7 /* syscall number = exit */ 9 | /* system call */ 10 | SWI $0 11 | RET /* not reached */ 12 | -------------------------------------------------------------------------------- /linker/Codegenv.mli: -------------------------------------------------------------------------------- 1 | (* This is used for the code layout. *) 2 | val size_of_instruction: 3 | Codegen.env -> Ast_asmv.instr Types.node -> int (* a multiple of 4 *) 4 | 5 | (* uses only config.init_text and for sanity checking only *) 6 | val gen: 7 | Types.symbol_table2 -> Exec_file.linker_config -> 8 | Ast_asmv.instr Types.code_graph -> 9 | Types.word list 10 | -------------------------------------------------------------------------------- /linker/Execgen.mli: -------------------------------------------------------------------------------- 1 | (*s: Execgen.mli *) 2 | 3 | (*s: signature [[Execgen.gen]] *) 4 | val gen: 5 | Exec_file.linker_config -> Exec_file.sections_size -> 6 | Types.word list (* code *) -> Types.byte array (* data *) -> 7 | Types.symbol_table2 (* for finding entry point *) -> 8 | Chan.o -> 9 | unit 10 | (*e: signature [[Execgen.gen]] *) 11 | (*e: Execgen.mli *) 12 | -------------------------------------------------------------------------------- /install.txt: -------------------------------------------------------------------------------- 1 | Requirements: 2 | - OCaml (ocamlrun, ocamlc, OCaml stdlib), and OPAM 3 | - The stdcompat and ocamlfind OPAM packages 4 | - rc, the plan9 shell (until we can boostrap it from rc in xix) 5 | - OPTIONAL: kencc for kernel/ (until we can bootstrap it from the 5a/5c/5l in xix) 6 | 7 | Then: 8 | $ ./bootstrap-mk.sh 9 | $ source env.sh 10 | $ mk depend 11 | $ mk 12 | -------------------------------------------------------------------------------- /kernel/concurrency/Spl.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | open Types 3 | open Spl_ 4 | 5 | (* Set Priority Level (=~ enable/disable interrupts) *) 6 | 7 | type prio = Spl_.prio 8 | 9 | let high () : prio = 10 | raise Todo 11 | 12 | let low () : prio = 13 | raise Todo 14 | 15 | let set (_prio : prio) : unit = 16 | raise Todo 17 | 18 | let is_low () : bool = 19 | raise Todo 20 | 21 | -------------------------------------------------------------------------------- /lib_graphics/input/tests/mkfile: -------------------------------------------------------------------------------- 1 | 2 | hellodraw2: hellodraw2.cmo mkfile 3 | $OCAMLC -verbose $OCAMLLDFLAGS -thread -custom -o $target unix.cma threads.cma str.cma $LIBS hellorio.cmo -cclib /home/pad/plan9/ROOT/386/lib/ocaml/libunix.a -cclib /home/pad/plan9/ROOT/386/lib/ocaml/libstr.a -cclib /home/pad/plan9/ROOT/386/lib/ocaml/libthreads.a -cclib /home/pad/github/fork-ocaml/byterun/main.8 4 | -------------------------------------------------------------------------------- /lib_gui/tests/mkfile: -------------------------------------------------------------------------------- 1 | TOP=../.. 2 | 3 | DEPS=lib_core/commons \ 4 | lib_gui/lib_graphics/geometry lib_gui/lib_graphics/input\ 5 | lib_gui/lib_graphics/draw \ 6 | lib_gui 7 | 8 | SRC= hellogui.ml 9 | 10 | PROG=hellogui 11 | SYSLIBS=str.cma graphics.cma 12 | 13 | INCLUDES=${DEPS:%=-I $TOP/%} 14 | LIBS=${DEPS:%=$TOP/%/lib.cma} 15 | 16 | <$TOP/mkconfig 17 | <$TOP/mkprog 18 | -------------------------------------------------------------------------------- /linker/Layout.mli: -------------------------------------------------------------------------------- 1 | 2 | (* Returns symbol_table2 with SData2 and SBss2 entries populated. 3 | * Returns also data_size x bss_size. 4 | *) 5 | val layout_data: 6 | Types.symbol_table -> Types.data list -> 7 | Types.symbol_table2 * (int * int) 8 | 9 | val xdefine: 10 | Types.symbol_table2 -> Types.symbol_table -> Types.symbol -> Types.section2 -> 11 | unit 12 | 13 | -------------------------------------------------------------------------------- /lib_graphics/draw/Baselayer.mli: -------------------------------------------------------------------------------- 1 | 2 | type t = { 3 | id: int; 4 | (* those images are stored server-side and never used client side 5 | * so we don't need to keep a reference on them here 6 | * base: Image.t; 7 | * fill: Image.t; 8 | *) 9 | display: Display.t; 10 | } 11 | 12 | val alloc: Display.image -> Display.image -> t 13 | 14 | val free: t -> unit 15 | 16 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/tests/mkfile: -------------------------------------------------------------------------------- 1 | TOP=../../../.. 2 | 3 | DEPS=lib_core/commons \ 4 | lib_gui/lib_graphics/geometry\ 5 | lib_gui/lib_graphics/draw\ 6 | 7 | SRC=hellodraw.ml 8 | 9 | PROG=hellodraw 10 | SYSLIBS=unix.cma str.cma graphics.cma 11 | 12 | 13 | INCLUDES=${DEPS:%=-I $TOP/%} 14 | LIBS=${DEPS:%=$TOP/%/lib.cma} 15 | 16 | <$TOP/mkconfig 17 | <$TOP/mkprog 18 | -------------------------------------------------------------------------------- /tests/compiler/extensions/unnamed_union.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | // anonymous struct and anonymous field! 3 | struct { 4 | float z; 5 | }; 6 | // this is common in regular C code 7 | union { 8 | int x; 9 | float y; 10 | }; 11 | }; 12 | 13 | 14 | struct Bar { 15 | struct Foo; 16 | }; 17 | 18 | float foo () { 19 | struct Foo x; 20 | 21 | return x.z; 22 | } 23 | -------------------------------------------------------------------------------- /compiler/Globals.ml: -------------------------------------------------------------------------------- 1 | (*s: Globals.ml *) 2 | (* Copyright 2016 Yoann Padioleau, see copyright.txt *) 3 | 4 | (* See also globals in ../macroprocessor/location_cpp.ml *) 5 | 6 | (*s: global [[Globals.hids]] *) 7 | (* to recognize typedefs in the lexer *) 8 | let hids: (string, Ast.idkind) Hashtbl.t = 9 | Hashtbl.create 101 10 | (*e: global [[Globals.hids]] *) 11 | (*e: Globals.ml *) 12 | -------------------------------------------------------------------------------- /kernel/time/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES= -I ../core -I ../concurrency_/ -I ../base -I ../concurrency -I ../processes -I ../scheduler -I $TOP/lib_core/commons 5 | SRC= Hz_clock.ml \ 6 | Time.ml Timer.ml Timers.ml \ 7 | Alarms.ml \ 8 | Time_rendez.ml Timer_interrupt.ml \ 9 | syssleep.ml sysalarm.ml 10 | 11 | 12 | <$TOP/mkconfig 13 | <$TOP/mkfiles/mklib 14 | -------------------------------------------------------------------------------- /mkfiles/mkconfig.plan9: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | OCAML=/home/pad/github/fork-ocaml 4 | OCAMLC=$OCAML/byterun/ocamlrun $OCAML/ocamlc 5 | OCAMLDEP=ocamldep 6 | 7 | COMPFLAGS=-thread -g 8 | LINKFLAGS=-thread -custom -g -I /home/pad/plan9/ROOT/$objtype/lib/ocaml 9 | #-verbose 10 | 11 | # for the linker 12 | #CAMLLIB=/usr/local/lib/ocaml 13 | CAMLLIB=/home/pad/plan9/ROOT/usr/local/lib/ocaml 14 | -------------------------------------------------------------------------------- /shell/Builtin.mli: -------------------------------------------------------------------------------- 1 | (*s: Builtin.mli *) 2 | (*s: signature [[Builtin.is_builtin]] *) 3 | val is_builtin : string -> bool 4 | (*e: signature [[Builtin.is_builtin]] *) 5 | 6 | (*s: signature [[Builtin.dispatch]] *) 7 | (* execute the builtin *) 8 | val dispatch : < Cap.chdir ; Cap.exit ; Cap.open_in; .. > -> string -> unit 9 | (*e: signature [[Builtin.dispatch]] *) 10 | (*e: Builtin.mli *) 11 | -------------------------------------------------------------------------------- /tests/snapshots/xix/323ff00ac45d/stdxxx: -------------------------------------------------------------------------------- 1 | 0: Pseudo( 2 | TEXT({name="foo"; priv=None; sig=None; }, {dupok=false; no_prof=false; }, 4)) 3 | 1: (MOVE(Word, None, Imsr(Imm(1)), Imsr(Reg(R(0)))), AL) 4 | 2: (MOVE(Word, None, Imsr(Reg(R(0))), Entity(Local(Some("x"), -4))), AL) 5 | 3: (MOVE(Word, None, Entity(Local(Some("x"), -4)), Imsr(Reg(R(0)))), AL) 6 | 4: Virtual(RET) 7 | 5: Virtual(RET) 8 | -------------------------------------------------------------------------------- /tests/snapshots/xix/d57c95967180/stdxxx: -------------------------------------------------------------------------------- 1 | 0: Pseudo( 2 | TEXT({name="foo"; priv=None; sig=None; }, {dupok=false; no_prof=false; }, 4)) 3 | 1: (MOVE(Word, None, Imsr(Imm(42)), Imsr(Reg(R(0)))), AL) 4 | 2: (MOVE(Word, None, Imsr(Reg(R(0))), Entity(Local(Some("z"), -4))), AL) 5 | 3: (MOVE(Word, None, Entity(Local(Some("z"), -4)), Imsr(Reg(R(0)))), AL) 6 | 4: Virtual(RET) 7 | 5: Virtual(RET) 8 | -------------------------------------------------------------------------------- /tests/snapshots/xix/f5624516e7b9/stdxxx: -------------------------------------------------------------------------------- 1 | 0: Pseudo( 2 | TEXT({name="foo"; priv=None; sig=None; }, {dupok=false; no_prof=false; }, 4)) 3 | 1: (MOVE(Word, None, Imsr(Imm(1)), Imsr(Reg(R(0)))), AL) 4 | 2: (MOVE(Word, None, Imsr(Reg(R(0))), Entity(Local(Some("x"), -4))), AL) 5 | 3: (MOVE(Word, None, Entity(Local(Some("x"), -4)), Imsr(Reg(R(0)))), AL) 6 | 4: Virtual(RET) 7 | 5: Virtual(RET) 8 | -------------------------------------------------------------------------------- /kernel/Libc/port/strncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char* 5 | strncpy(char *s1, char *s2, long n) 6 | { 7 | int i; 8 | char *os1; 9 | 10 | os1 = s1; 11 | for(i = 0; i < n; i++) 12 | if((*s1++ = *s2++) == 0) { 13 | while(++i < n) 14 | *s1++ = 0; 15 | return os1; 16 | } 17 | return os1; 18 | } 19 | -------------------------------------------------------------------------------- /tests/compiler/typing/struct_compatibility.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | int x; 3 | int y; 4 | }; 5 | 6 | struct Bar { 7 | int x; 8 | float z; // 5c accepts even if different names, but not if different type! 9 | }; 10 | 11 | 12 | // clang does not support it, even if structures are the same 13 | struct Foo x; 14 | struct Bar x; 15 | 16 | // this is ok with clang 17 | int y; 18 | int y; 19 | -------------------------------------------------------------------------------- /kernel/core/Error.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | (* As in ocaml source so easier for pretty printing *) 4 | (* less: could spread in different directories *) 5 | type error = 6 | | Ebadarg 7 | | Enovmem 8 | | Esoverlap 9 | | Enochild 10 | | Ebadexec 11 | exception Error of error 12 | 13 | let error x = raise (Error x) 14 | 15 | let panic str = 16 | raise (Impossible ("panic: " ^ str)) 17 | -------------------------------------------------------------------------------- /windows/tests/dune: -------------------------------------------------------------------------------- 1 | (executable 2 | (name Hellorio) 3 | (libraries 4 | str unix 5 | xix_commons 6 | xix_graphics_input 7 | xix_plan9 8 | xix_graphics_ui 9 | ) 10 | (preprocess (pps ppx_deriving.show)) 11 | (modes native byte)) 12 | 13 | ;(install 14 | ; (package xix) 15 | ; (section bin) 16 | ; (files 17 | ; (Hellorio.exe as orio) 18 | ; (Main.bc as orio.bc) 19 | ;) 20 | ;) 21 | -------------------------------------------------------------------------------- /bin/ocamlcflags: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OCAML_VERSION_MAJOR=`ocamlc -version | cut -f1 -d.` 4 | #OCAML_VERSION_MINOR = `ocamlopt -version | cut -f2 -d.` 5 | #OCAML_VERSION_POINT = `ocamlopt -version | cut -f3 -d.` 6 | 7 | case "$OCAML_VERSION_MAJOR" in 8 | "3") ;; 9 | "4") 10 | echo "-absname -bin-annot";; 11 | "5") 12 | echo "-absname -bin-annot";; 13 | "*") ;; 14 | esac 15 | -------------------------------------------------------------------------------- /tests/compiler/extensions/unnamed_unsugar.c: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | int x; 3 | int y; 4 | }; 5 | 6 | 7 | struct Bar { 8 | struct Foo __1; 9 | int z; 10 | }; 11 | 12 | int foo(struct Bar* x) { 13 | return x->__1.x; 14 | } 15 | 16 | int bar(struct Foo* x) { 17 | return x->x; 18 | } 19 | 20 | 21 | void test_bar() { 22 | struct Bar x; 23 | //bar(&x); 24 | bar(& (&x)->__1); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tests/compiler/typing/pointer_minus.c: -------------------------------------------------------------------------------- 1 | void foo() { 2 | int *x; 3 | int *y; 4 | int *z; 5 | long d; 6 | 7 | z = x + 1; 8 | z = 1 + x; 9 | 10 | // forbidden 11 | // x+y; 12 | // ok with 5c 13 | d = x - y; 14 | 15 | // forbidden 16 | //x+=y; 17 | // forbidden 18 | // x-=y; 19 | // because convert to 20 | // x = x - y; 21 | // and x should be a long! 22 | 23 | } 24 | -------------------------------------------------------------------------------- /kernel/Libgeometry/fmt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | Rfmt(Fmt *f) 7 | { 8 | Rectangle r; 9 | 10 | r = va_arg(f->args, Rectangle); 11 | return fmtprint(f, "%P %P", r.min, r.max); 12 | } 13 | 14 | int 15 | Pfmt(Fmt *f) 16 | { 17 | Point p; 18 | 19 | p = va_arg(f->args, Point); 20 | return fmtprint(f, "[%d %d]", p.x, p.y); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /kernel/Port/portfns_buses.h: -------------------------------------------------------------------------------- 1 | 2 | // devuart.c 3 | int uartgetc(void); 4 | void uartputs(char*, int); 5 | void uartrecv(Uart*, char); 6 | int uartctl(Uart*, char*); 7 | int uartstageoutput(Uart*); 8 | void uartkick(void*); 9 | 10 | // TODO: move outside main.c? 11 | // /main.c for now (called from port) 12 | //int arch_isaconfig(char*, int, ISAConf*); // now in core/ for backward deps 13 | 14 | -------------------------------------------------------------------------------- /lib_graphics/draw/tests/dune: -------------------------------------------------------------------------------- 1 | (executable 2 | (name Hellodraw) 3 | (libraries 4 | str unix 5 | xix_commons 6 | xix_graphics_input 7 | xix_plan9 8 | xix_graphics_ui 9 | ) 10 | (preprocess (pps ppx_deriving.show)) 11 | (modes native byte)) 12 | 13 | ;(install 14 | ; (package xix) 15 | ; (section bin) 16 | ; (files 17 | ; (Hellorio.exe as orio) 18 | ; (Main.bc as orio.bc) 19 | ;) 20 | ;) 21 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/draw/display.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | type t = { 4 | (* the "screen" (or "view" when run inside a window) *) 5 | image: Image.t; 6 | } 7 | 8 | let init () = 9 | let _ = Graphics.open_graph " 1000x1000" in 10 | let r = Rectangle.r 0 0 (Graphics.size_x()) (Graphics.size_y()) in 11 | { image = 12 | { Image.r = r; 13 | kind = Image.Screen; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /linker/Rewrite5.mli: -------------------------------------------------------------------------------- 1 | (*s: Rewrite5.mli *) 2 | 3 | (*s: signature [[Rewrite5.rewrite]] *) 4 | (* Mostly TEXT/RET rewrite depending whether a function is a "leaf". 5 | * !!actually works by side effect on graph so take care!! 6 | * may raise Failure in case of error. 7 | *) 8 | val rewrite: 9 | Types5.code_graph -> Types5.code_graph 10 | (*e: signature [[Rewrite5.rewrite]] *) 11 | (*e: Rewrite5.mli *) 12 | -------------------------------------------------------------------------------- /shell/Interpreter.mli: -------------------------------------------------------------------------------- 1 | (*s: Interpreter.mli *) 2 | (*s: signature [[Interpreter.interpret_operation]] *) 3 | (* Interpret one operation. Called from a loop in main(). *) 4 | val interpret_operation : 5 | < Cap.fork ; Cap.exec ; Cap.wait; Cap.chdir ; Cap.exit ; Cap.open_in; .. > -> 6 | Opcode.operation -> 7 | unit 8 | (*e: signature [[Interpreter.interpret_operation]] *) 9 | (*e: Interpreter.mli *) 10 | -------------------------------------------------------------------------------- /tests/compiler/codegen/if.c: -------------------------------------------------------------------------------- 1 | int foo(int x) { 2 | int res; 3 | 4 | // this actually does not generate any branching code on ARM 5 | // because of the conditional execution trick when optimized! 6 | 7 | // CMP $0,R0, 8 | // MOVW.NE $1,R2 9 | // MOVW.EQ $2,R2 10 | // MOVW R2,R0 11 | // RET , 12 | 13 | if(x) { 14 | res = 1; 15 | } else { 16 | res = 2; 17 | } 18 | return res; 19 | } 20 | -------------------------------------------------------------------------------- /windows/Virtual_cons.mli: -------------------------------------------------------------------------------- 1 | (*s: Virtual_cons.mli *) 2 | 3 | (*s: signature [[Virtual_cons.dev_cons]] *) 4 | (* virtual "/dev/cons" *) 5 | val dev_cons : Device.t 6 | (*e: signature [[Virtual_cons.dev_cons]] *) 7 | (*s: signature [[Virtual_cons.dev_consctl]] *) 8 | (* virtual "/dev/consctl" *) 9 | val dev_consctl : Device.t 10 | (*e: signature [[Virtual_cons.dev_consctl]] *) 11 | (*e: Virtual_cons.mli *) 12 | -------------------------------------------------------------------------------- /kernel/concurrency_/Qlock_.ml: -------------------------------------------------------------------------------- 1 | open Types 2 | 3 | (* we can not put this type in concurrency/ because of mutual deps 4 | * between locks and a proc. 5 | *) 6 | type t = { 7 | mutable locked: bool; 8 | (* less: opti: I use pids to avoid mutual deps with Proc, but slower *) 9 | q: pid Queue.t; 10 | 11 | (* less: debugging fields 12 | * pc: kern_addr; 13 | *) 14 | 15 | l: Spinlock_.t; 16 | } 17 | -------------------------------------------------------------------------------- /kernel/memory/User_memory.mli: -------------------------------------------------------------------------------- 1 | 2 | module Operators : sig 3 | val (@<): Types.user_addr -> Types.user_addr -> bool 4 | val (@>): Types.user_addr -> Types.user_addr -> bool 5 | val (@>=): Types.user_addr -> Types.user_addr -> bool 6 | 7 | val (@+): Types.user_addr -> int -> Types.user_addr 8 | val (@-): Types.user_addr -> Types.user_addr -> int 9 | end 10 | 11 | val roundup_page: Types.user_addr -> Types.user_addr 12 | -------------------------------------------------------------------------------- /lib_core/commons/Fpath_.mli: -------------------------------------------------------------------------------- 1 | 2 | val of_strings : string list -> Fpath.t list 3 | val to_strings : Fpath.t list -> string list 4 | 5 | module Operators : sig 6 | (* Fpath.add_seg = Fpath.(/) *) 7 | val ( / ) : Fpath.t -> string -> Fpath.t 8 | 9 | (* Fpath.append = Fpath.(//) *) 10 | val ( // ) : Fpath.t -> Fpath.t -> Fpath.t 11 | 12 | (* Fpath.to_string *) 13 | val ( !! ) : Fpath.t -> string 14 | end 15 | -------------------------------------------------------------------------------- /windows/Processes_winshell.mli: -------------------------------------------------------------------------------- 1 | (*s: Processes_winshell.mli *) 2 | 3 | (*s: signature [[Processes_winshell.run_cmd_in_window_in_child_of_fork]] *) 4 | val run_cmd_in_window_in_child_of_fork: 5 | < Cap.chdir; Cap.exec; Cap.mount; Cap.bind; .. > -> 6 | string -> string array -> Window.t -> Fileserver.t -> unit 7 | (*e: signature [[Processes_winshell.run_cmd_in_window_in_child_of_fork]] *) 8 | (*e: Processes_winshell.mli *) 9 | -------------------------------------------------------------------------------- /lib_core/commons/FS.mli: -------------------------------------------------------------------------------- 1 | 2 | val with_open_in : 3 | -> (Chan.i -> 'a) -> Fpath.t -> 'a 4 | val with_open_out : 5 | -> (Chan.o -> 'a) -> Fpath.t -> 'a 6 | 7 | val cat : -> Fpath.t -> string list 8 | 9 | (* use Cap.open_out as removing a file is similar to erasing/overwriting 10 | * its content. 11 | *) 12 | val remove: -> Fpath.t -> unit 13 | -------------------------------------------------------------------------------- /linker/executables/A_out.mli: -------------------------------------------------------------------------------- 1 | (*s: executables/A_out.mli *) 2 | 3 | (*s: signature [[A_out.header_size]] *) 4 | val header_size: int 5 | (*e: signature [[A_out.header_size]] *) 6 | 7 | (*s: signature [[A_out.write_header]] *) 8 | val write_header: 9 | Arch.t -> 10 | Exec_file.sections_size -> int (* entry_addr *) -> out_channel -> unit 11 | (*e: signature [[A_out.write_header]] *) 12 | (*e: executables/A_out.mli *) 13 | -------------------------------------------------------------------------------- /vcs/dune: -------------------------------------------------------------------------------- 1 | (executable 2 | (name Main) 3 | (libraries 4 | str unix 5 | camlzip 6 | xix_commons xix_crypto xix_compression 7 | ) 8 | ; 'byte' is for ocamldebug 9 | (modes native byte)) 10 | 11 | (install 12 | (package xix) 13 | (section bin) 14 | (files 15 | (Main.exe as ogit) 16 | ; useful to debug, see ../../debug and ocamldebug 17 | (Main.bc as ogit.bc)) 18 | ) 19 | 20 | (dirs :standard \ docs) 21 | -------------------------------------------------------------------------------- /kernel/Byterun/backtrace.h: -------------------------------------------------------------------------------- 1 | #ifndef _backtrace_ 2 | #define _backtrace_ 3 | 4 | #include "mlvalues.h" 5 | 6 | extern int backtrace_active; 7 | extern int backtrace_pos; 8 | extern code_t * backtrace_buffer; 9 | extern value backtrace_last_exn; 10 | 11 | extern void init_backtrace(void); 12 | extern void stash_backtrace(value exn, code_t pc, value * sp); 13 | extern void print_exception_backtrace(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /kernel/Libc/fmt/fmtprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "fmtdef.h" 4 | 5 | 6 | /* 7 | * format a string into the output buffer 8 | * designed for formats which themselves call fmt 9 | */ 10 | int 11 | fmtprint(Fmt *f, char *fmt, ...) 12 | { 13 | va_list va; 14 | int n; 15 | 16 | va_start(va, fmt); 17 | n = fmtvprint(f, fmt, va); 18 | va_end(va); 19 | return n; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /kernel/concurrency/Tas.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | (* Test And Set, the concurrency building block 4 | *) 5 | 6 | (* todo: external arch_tas: bool ref -> bool = "caml_tas" *) 7 | 8 | (* tas() get the old content, set the ref, and then return 9 | * the old content. 10 | * 11 | * todo: for now no concurrency in ocaml so pretty simple ... 12 | *) 13 | let tas (boolref : bool ref) : bool = 14 | boolref := true; 15 | false 16 | -------------------------------------------------------------------------------- /kernel/core/Conf.ml: -------------------------------------------------------------------------------- 1 | open Types 2 | 3 | type confmem = { 4 | base: phys_addr; 5 | limit: phys_addr; 6 | (* less: npage: *) 7 | 8 | } 9 | 10 | type t = { 11 | ncpu: int; 12 | mem: confmem list; 13 | nproc: int; 14 | 15 | (* set in Main.confinit *) 16 | user_pages: int; 17 | kernel_pages: int; 18 | 19 | (* upage+kpage *) 20 | npages: int; 21 | } 22 | 23 | (* less: let config = Hashtbl.create 101 *) 24 | -------------------------------------------------------------------------------- /lib_core/compression/compression.mli: -------------------------------------------------------------------------------- 1 | (*s: version_control/compression.mli *) 2 | 3 | (*s: signature [[Compression.decompress]] *) 4 | val decompress: 5 | IO.input -> IO.input 6 | (*e: signature [[Compression.decompress]] *) 7 | (*s: signature [[Compression.compress]] *) 8 | val compress: 9 | IO.input -> 'a IO.output -> unit 10 | (*e: signature [[Compression.compress]] *) 11 | (*e: version_control/compression.mli *) 12 | -------------------------------------------------------------------------------- /linker/Resolve.mli: -------------------------------------------------------------------------------- 1 | (*s: Resolve.mli *) 2 | 3 | (*s: signature [[Resolve.build_graph]] *) 4 | (* !! will modify the code to resolve SymbolJump so take care!! 5 | * raise Failure in case of error. 6 | *) 7 | val build_graph: 8 | ('instr -> Ast_asm.branch_operand option) -> 9 | Types.symbol_table -> 'instr Types.code array -> 'instr Types.code_graph 10 | (*e: signature [[Resolve.build_graph]] *) 11 | (*e: Resolve.mli *) 12 | -------------------------------------------------------------------------------- /kernel/Libc/port/utflen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | utflen(char *s) 6 | { 7 | int c; 8 | long n; 9 | Rune rune; 10 | 11 | n = 0; 12 | for(;;) { 13 | c = *(uchar*)s; 14 | if(c < Runeself) { 15 | if(c == 0) 16 | return n; 17 | s++; 18 | } else 19 | s += chartorune(&rune, s); 20 | n++; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /macroprocessor/mkfile: -------------------------------------------------------------------------------- 1 | TOP=.. 2 | 3 | INCLUDES=-I $TOP/lib_core/commons 4 | 5 | SRC= Flags_cpp.ml Location_cpp.ml Ast_cpp.ml Lexer_cpp.ml Preprocessor.ml \ 6 | Parse_cpp.ml 7 | 8 | <$TOP/mkconfig 9 | <$TOP/mkfiles/mklib 10 | 11 | #<$TOP/mkparser 12 | 13 | AUTOGEN=Lexer_cpp.ml 14 | NUKEFILES=$AUTOGEN 15 | 16 | beforedepend:V: $AUTOGEN 17 | depend:V: beforedepend 18 | 19 | Lexer_cpp.ml:D: Lexer_cpp.mll 20 | $OCAMLLEX $prereq 21 | -------------------------------------------------------------------------------- /shell/Prompt.mli: -------------------------------------------------------------------------------- 1 | (*s: Prompt.mli *) 2 | (*s: signature [[Prompt.doprompt]] *) 3 | val doprompt : bool ref 4 | (*e: signature [[Prompt.doprompt]] *) 5 | (*s: signature [[Prompt.prompt]] *) 6 | val prompt : string ref 7 | (*e: signature [[Prompt.prompt]] *) 8 | 9 | (*s: signature [[Prompt.pprompt]] *) 10 | (* !will reset doprompt! *) 11 | val pprompt : unit -> unit 12 | (*e: signature [[Prompt.pprompt]] *) 13 | (*e: Prompt.mli *) 14 | -------------------------------------------------------------------------------- /lib_core/system/plan9/mount.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "plan9support.h" 4 | 5 | #include 6 | 7 | value plan9_mount(value fd, value int1, value dst, value flags, value args) /* ML */ 8 | { 9 | int ret; 10 | ret = mount(Int_val(fd), Int_val(int1), String_val(dst), Int_val(flags), 11 | String_val(args)); 12 | if (ret < 0) p9error("mount"); 13 | return Val_int(ret); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /lib_graphics/draw/Draw.mli: -------------------------------------------------------------------------------- 1 | 2 | val init: -> string (* e.g., "rio" *) -> Display.t 3 | 4 | val draw: 5 | Image.t -> Rectangle.t -> Image.t -> Image.t option -> Point.t -> unit 6 | 7 | val draw_color: 8 | Image.t -> Rectangle.t -> Image.t -> unit 9 | 10 | val alloc_mix_colors: Display.t -> Color.t -> Color.t -> Image.t 11 | 12 | type op = 13 | | SoverD 14 | 15 | val adjust_str_for_op : string -> op -> string 16 | -------------------------------------------------------------------------------- /compiler/Parse.mli: -------------------------------------------------------------------------------- 1 | (*s: Parse.mli *) 2 | 3 | (*s: signature [[Parse.parse]] *) 4 | (* will macropreprocess internally first *) 5 | val parse: 6 | < Cap.open_in; .. > -> Preprocessor.conf -> Fpath.t -> Ast.program 7 | (*e: signature [[Parse.parse]] *) 8 | 9 | (*s: signature [[Parse.parse_no_cpp]] *) 10 | (* internals *) 11 | val parse_no_cpp: 12 | Chan.i -> Ast.program 13 | (*e: signature [[Parse.parse_no_cpp]] *) 14 | (*e: Parse.mli *) 15 | -------------------------------------------------------------------------------- /generators/yacc/Check.mli: -------------------------------------------------------------------------------- 1 | (*s: yacc/Check.mli *) 2 | 3 | (*s: type [[Check.error]](yacc) *) 4 | type error = unit 5 | (*e: type [[Check.error]](yacc) *) 6 | 7 | (*s: exception [[Check.Error]](yacc) *) 8 | exception Error of error 9 | (*e: exception [[Check.Error]](yacc) *) 10 | 11 | (*s: signature [[Check.check]](yacc) *) 12 | val check: Ast.parser_definition -> unit 13 | (*e: signature [[Check.check]](yacc) *) 14 | (*e: yacc/Check.mli *) 15 | -------------------------------------------------------------------------------- /lib_core/commons/Ord.ml: -------------------------------------------------------------------------------- 1 | 2 | (* TODO: Lt, Eq, Gt, but need to also modidfy semgrep-libs *) 3 | type t = Less | Equal | Greater 4 | 5 | let to_comparison f = 6 | fun x y -> 7 | let res = f x y in 8 | if res < 0 then Less else if res > 0 then Greater else Equal 9 | 10 | module Operators = struct 11 | let (<=>) a b = 12 | if a = b 13 | then Equal 14 | else 15 | if a < b 16 | then Less 17 | else Greater 18 | 19 | end 20 | -------------------------------------------------------------------------------- /windows/Dev_wm.ml: -------------------------------------------------------------------------------- 1 | (*s: Dev_wm.ml *) 2 | open Common 3 | 4 | open Device 5 | module W = Window 6 | 7 | (*s: constant [[Dev_wm.dev_winid]] *) 8 | let dev_winid = { Device.default with 9 | name = "winid"; 10 | perm = Plan9.r; 11 | read_threaded = (fun offset count w -> 12 | let str = spf "%11d" w.W.id in 13 | Device.honor_offset_and_count offset count str 14 | ); 15 | } 16 | (*e: constant [[Dev_wm.dev_winid]] *) 17 | (*e: Dev_wm.ml *) 18 | -------------------------------------------------------------------------------- /kernel/core/Print.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | (* We could use print_string below, but it requires some hacks to make 4 | * it work in a kernel context. Indeed, there is not really a 5 | * descriptor 0 for the kernel. So, it is better to make _print assignable 6 | * to a specific external C function (e.g., screenputs C). 7 | *) 8 | let (_print: (string -> unit) ref) = 9 | ref (fun _s -> failwith "Common._print not defined") 10 | let print s = !_print s 11 | -------------------------------------------------------------------------------- /lib_core/misc/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | TOP=../.. 4 | INCLUDES=-I . 5 | 6 | # We need camlinternalOO.ml to compile commons/Cap.ml otherwise 7 | # ocamlc throws some weird "fatal error missing primitive create_object_opt". 8 | # Apparently ocamlc has some magic to find and load a camlinternalOO.cmo 9 | # We can't put this in lib_core/core/ because it relies on String and Map 10 | SRC=camlinternalOO.ml 11 | 12 | <$TOP/mkconfig 13 | <$TOP/mkfiles/mklib 14 | -------------------------------------------------------------------------------- /kernel/Libc/port/strncmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | strncmp(char *s1, char *s2, long n) 6 | { 7 | unsigned c1, c2; 8 | 9 | while(n > 0) { 10 | c1 = *s1++; 11 | c2 = *s2++; 12 | n--; 13 | if(c1 != c2) { 14 | if(c1 > c2) 15 | return 1; 16 | return -1; 17 | } 18 | if(c1 == 0) 19 | break; 20 | } 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /kernel/Libc/port/utfecpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char* 5 | utfecpy(char *to, char *e, char *from) 6 | { 7 | char *end; 8 | 9 | if(to >= e) 10 | return to; 11 | end = memccpy(to, from, '\0', e - to); 12 | if(end == nil){ 13 | end = e; 14 | while(end>to && (*--end&0xC0)==0x80) 15 | ; 16 | *end = '\0'; 17 | }else{ 18 | end--; 19 | } 20 | return end; 21 | } 22 | -------------------------------------------------------------------------------- /kernel/concurrency_/Rendez_.ml: -------------------------------------------------------------------------------- 1 | open Types 2 | 3 | (* A rendez-vous is a place where a process will sleep until someone 4 | * else wake him up. 5 | *) 6 | type t = { 7 | (* less: opti: direct Proc_.t reference *) 8 | mutable p: pid option; 9 | (* !lock ordering! r.l before p.rlock *) 10 | (* todo: why need a lock on the rendezvous? because when want to sleep on it, 11 | * we dont want a wakeup to be lost? 12 | *) 13 | l: Spinlock_.t; 14 | } 15 | -------------------------------------------------------------------------------- /linker/Layoutv.mli: -------------------------------------------------------------------------------- 1 | (* Returns symbol_table2 with SText2 entries populated. 2 | * Returns also nodes in code_graph with their real_pc field set. 3 | * Returns also text_size. 4 | * !! works by side effect on code_graph and symbol_table2, so take care !! 5 | *) 6 | val layout_text: 7 | Types.symbol_table2 -> Types.real_pc (* INITTEXT *) -> 8 | Ast_asmv.instr Types.code_graph -> 9 | Types.symbol_table2 * Ast_asmv.instr Types.code_graph * int 10 | 11 | -------------------------------------------------------------------------------- /tests/snapshots/xix/2cfe73530a0b/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 4))) 4 | 1: (Instr 5 | (Move2 (W__, (Left (Gen (Entity (Local ((Some "x"), -4))))), 6 | (Gen (GReg (R 8)))))) 7 | 2: (Instr (Move2 (W__, (Right (Int 1)), (Gen (GReg (R 5)))))) 8 | 3: (Instr (Arith ((ADD None), (Reg (R 5)), None, (R 8)))) 9 | 4: (Virtual RET) 10 | 5: (Virtual RET) 11 | -------------------------------------------------------------------------------- /windows/Mouse_action.mli: -------------------------------------------------------------------------------- 1 | (*s: Mouse_action.mli *) 2 | 3 | (*s: signature [[Mouse_action.sweep]] *) 4 | (* allows to specify a window area *) 5 | val sweep: 6 | Mouse.ctl -> (Display.t * Baselayer.t * Font.t) -> Image.t option 7 | (*e: signature [[Mouse_action.sweep]] *) 8 | 9 | (*s: signature [[Mouse_action.point_to]] *) 10 | val point_to: 11 | Mouse.ctl -> Window.t option 12 | (*e: signature [[Mouse_action.point_to]] *) 13 | (*e: Mouse_action.mli *) 14 | -------------------------------------------------------------------------------- /assembler/Parse_asm5.mli: -------------------------------------------------------------------------------- 1 | (*s: Parse_asm5.mli *) 2 | 3 | (*s: signature [[Parse_asm5.parse]] *) 4 | (* will preprocess the code internally first *) 5 | val parse: 6 | < Cap.open_in; .. > -> Preprocessor.conf -> Fpath.t -> Ast_asm5.program 7 | (*e: signature [[Parse_asm5.parse]] *) 8 | 9 | (*s: signature [[Parse_asm5.parse_no_cpp]] *) 10 | val parse_no_cpp: Chan.i -> Ast_asm5.program 11 | (*e: signature [[Parse_asm5.parse_no_cpp]] *) 12 | (*e: Parse_asm5.mli *) 13 | -------------------------------------------------------------------------------- /compiler/Meta_storage.ml: -------------------------------------------------------------------------------- 1 | (* generated by ocamltarzan with: camlp4o -o /tmp/yyy.ml -I pa/ pa_type_conv.cmo pa_vof.cmo pr_o.cmo /tmp/xxx.ml *) 2 | 3 | open Storage 4 | 5 | module Ocaml = OCaml 6 | 7 | let vof_t = 8 | function 9 | | Local -> Ocaml.VSum (("Local", [])) 10 | | Param -> Ocaml.VSum (("Param", [])) 11 | | Extern -> Ocaml.VSum (("Extern", [])) 12 | | Global -> Ocaml.VSum (("Global", [])) 13 | | Static -> Ocaml.VSum (("Static", [])) 14 | 15 | -------------------------------------------------------------------------------- /tests/snapshots/xix/e21e6e3afcfe/stdxxx: -------------------------------------------------------------------------------- 1 | 0: (Pseudo 2 | (TEXT ({ Ast_asm.name = "foo"; priv = None; signature = None }, 3 | { dupok = false; no_prof = false }, 4))) 4 | 1: (Instr 5 | (Move2 (W__, (Left (Gen (Entity (Local ((Some "x"), -4))))), 6 | (Gen (GReg (R 1)))))) 7 | 2: (Instr (Move2 (W__, (Right (Int 1)), (Gen (GReg (R 2)))))) 8 | 3: (Instr (Arith ((ADD (W, S)), (Reg (R 2)), None, (R 1)))) 9 | 4: (Virtual RET) 10 | 5: (Virtual RET) 11 | -------------------------------------------------------------------------------- /utilities/text/ed/Error.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | exception Error of string 4 | 5 | (* the raise will effectively jump on the exn handler in CLI.main() 6 | * (emulating the longjmp done in C). 7 | *) 8 | let e s = 9 | raise (Error s) 10 | 11 | (* this will be called from CLI.main() in an handler for the Error exn *) 12 | let error_1 (e : Env.t) (s : string) : unit = 13 | (* TODO: reset globals too? *) 14 | Out.putchr e '?'; 15 | Out.putst e s; 16 | () 17 | -------------------------------------------------------------------------------- /kernel/Libc/arm/setjmp.s: -------------------------------------------------------------------------------- 1 | arg=0 2 | link=14 3 | sp=13 4 | 5 | TEXT setjmp(SB), 1, $-4 6 | MOVW R(sp), (R(arg+0)) 7 | MOVW R(link), 4(R(arg+0)) 8 | MOVW $0, R0 9 | RET 10 | 11 | TEXT longjmp(SB), 1, $-4 12 | MOVW r+4(FP), R(arg+2) 13 | CMP $0, R(arg+2) 14 | BNE ok /* ansi: "longjmp(0) => longjmp(1)" */ 15 | MOVW $1, R(arg+2) /* bless their pointed heads */ 16 | ok: MOVW (R(arg+0)), R(sp) 17 | MOVW 4(R(arg+0)), R(link) 18 | MOVW R(arg+2), R(arg+0) 19 | RET 20 | -------------------------------------------------------------------------------- /kernel/Libc/port/memcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | memcmp(void *a1, void *a2, ulong n) 6 | { 7 | uchar *s1, *s2; 8 | uint c1, c2; 9 | 10 | s1 = a1; 11 | s2 = a2; 12 | while(n > 0) { 13 | c1 = *s1++; 14 | c2 = *s2++; 15 | if(c1 != c2) { 16 | if(c1 > c2) 17 | return 1; 18 | return -1; 19 | } 20 | n--; 21 | } 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /lib_graphics/draw/mkfile: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | TOP=../.. 3 | 4 | INCLUDES=-I $TOP/lib_core/commons -I $TOP/lib_graphics/geometry 5 | 6 | SRC= Channel.ml Color.ml \ 7 | Draw_marshal.ml Display.ml Image.ml \ 8 | Draw_ipc.ml \ 9 | Draw.ml \ 10 | Line.ml Polygon.ml Ellipse.ml Arc.ml \ 11 | Fontchar.ml Subfont.ml Font.ml Font_default.ml Text.ml \ 12 | Baselayer.ml Layer.ml \ 13 | Draw_rio.ml 14 | 15 | <$TOP/mkconfig 16 | <$TOP/mkfiles/mklib 17 | -------------------------------------------------------------------------------- /lib_graphics/draw/Subfont.mli: -------------------------------------------------------------------------------- 1 | 2 | 3 | type t = { 4 | name: string; 5 | bits: Image.t; 6 | 7 | (* /* n+1 character descriptors */? still need n+1 trick? *) 8 | chars: Fontchar.t array; 9 | 10 | (*/* max height of image, interline spacing */*) 11 | height : int; 12 | (*/* top of image to baseline */*) 13 | ascent: int; 14 | 15 | (* less: refcounter ? *) 16 | } 17 | 18 | val alloc: string -> int -> int -> int -> Fontchar.t array -> Image.t -> t 19 | 20 | -------------------------------------------------------------------------------- /lib_gui/lib_graphics/input/mouse.mli: -------------------------------------------------------------------------------- 1 | open Common 2 | 3 | type state = { 4 | pos: Point.t; 5 | buttons: buttons; 6 | msec: int; 7 | } 8 | and buttons = { left: bool; middle: bool; right: bool; } 9 | 10 | val nobuttons: buttons 11 | 12 | type button = Left | Middle | Right 13 | 14 | val has_click: state -> bool 15 | val has_button: state -> button -> bool 16 | 17 | val mk: Point.t -> button -> state 18 | 19 | (* helpers *) 20 | val int_of_buttons: buttons -> int 21 | -------------------------------------------------------------------------------- /linker/Typesv.ml: -------------------------------------------------------------------------------- 1 | (* Copyright 2016, 2025 Yoann Padioleau, see copyright.txt *) 2 | open Common 3 | 4 | (*****************************************************************************) 5 | (* Types *) 6 | (*****************************************************************************) 7 | 8 | (* for ocaml-light, to work without deriving *) 9 | let show_instr _ = "NO DERIVING" 10 | [@@warning "-32"] 11 | 12 | type instr = Ast_asmv.instr Types.code_bis 13 | [@@deriving show] 14 | -------------------------------------------------------------------------------- /windows/tests/test_rio_console_app1.ml: -------------------------------------------------------------------------------- 1 | 2 | let main () = 3 | (* 4 | flush stdout; 5 | print_string "Hello World\n"; 6 | *) 7 | try 8 | let _n = Unix.write Unix.stdout "hello world\n" 0 12 in 9 | while true do 10 | () 11 | done 12 | with 13 | Unix.Unix_error (code, cmd, args) -> 14 | failwith (Printf.sprintf "Unix error: %s with %s(%s)" 15 | (Unix.error_message code) cmd args) 16 | 17 | let _ = 18 | main () 19 | -------------------------------------------------------------------------------- /kernel/Bcm/dat_memory.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * MMU stuff in proc 4 | */ 5 | #define NCOLOR 1 /* 1 level cache, don't worry about VCE's */ 6 | 7 | struct Arch_Proc 8 | { 9 | // list > pages used to store page tables 10 | Page* mmul2; 11 | // list > (next = Page.next) 12 | Page* mmul2cache; /* free mmu pages */ 13 | }; 14 | 15 | /* 16 | * Fake kmap. 17 | */ 18 | typedef void Arch_KMap; 19 | #define VA(k) ((uintptr)(k)) 20 | 21 | -------------------------------------------------------------------------------- /kernel/Libc/fmt/vseprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char* 5 | vseprint(char *buf, char *e, char *fmt, va_list args) 6 | { 7 | Fmt f; 8 | 9 | if(e <= buf) 10 | return nil; 11 | f.runes = 0; 12 | f.start = buf; 13 | f.to = buf; 14 | f.stop = e - 1; 15 | f.flush = nil; 16 | f.farg = nil; 17 | f.nfmt = 0; 18 | f.args = args; 19 | dofmt(&f, fmt); 20 | *(char*)f.to = '\0'; 21 | return f.to; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /utilities/files/mkfile: -------------------------------------------------------------------------------- 1 | TOP=../.. 2 | 3 | PROGS=ocat opwd 4 | 5 | INCLUDES=-I $TOP/lib_core/commons 6 | SYSLIBS=str.cma unix.cma 7 | LIBS=$TOP/lib_core/commons/lib.cma 8 | 9 | all:V: $PROGS 10 | 11 | <$TOP/mkconfig 12 | <$TOP/mkfiles/mkcommon 13 | 14 | o%: %.ml 15 | $OCAMLC $LINKFLAGS $EXTRALINKFLAGS $INCLUDES $SYSLIBS $LIBS $prereq $CCLIBS -o $target 16 | 17 | 18 | clean nuke:V: 19 | rm -f *.cm[ioxa] 20 | rm -f $PROGS 21 | 22 | opt:V: 23 | echo TODO 24 | -------------------------------------------------------------------------------- /kernel/memory/Kernel_memory.ml: -------------------------------------------------------------------------------- 1 | open Common 2 | open Types 3 | 4 | let kmap (_page : Page_.t) : unit = 5 | raise Todo 6 | 7 | let kunmap (_page : unit (* ??? not Page._t *)) : unit = 8 | raise Todo 9 | 10 | (* less: let va k = ... ? 11 | * or just duplicate the few memxxx function to take ka so 12 | * clearer interface and no need VA(k) as in C? 13 | *) 14 | 15 | let memclear _ka _size = 16 | Logs.err (fun m -> m "TODO: Kernel_memory.memclean") 17 | (*raise Todo*) 18 | 19 | -------------------------------------------------------------------------------- /lib_core/commons/Fpath.mli: -------------------------------------------------------------------------------- 1 | (* Poor's man filename library following the interface defined in 2 | * https://github.com/dbuenzli/fpath. 3 | *) 4 | 5 | (* The type for paths. *) 6 | type t 7 | [@@deriving show] 8 | 9 | (* The type for extensions. *) 10 | type ext = string 11 | [@@deriving show] 12 | 13 | (* [v s] is the string [s] as a path *) 14 | val v : string -> t 15 | 16 | val to_string: t -> string 17 | 18 | val add_seg : t -> string -> t 19 | 20 | val append: t -> t -> t 21 | -------------------------------------------------------------------------------- /lib_graphics/input/Keyboard.mli: -------------------------------------------------------------------------------- 1 | (* Raw keyboard device interaction *) 2 | 3 | type key = Rune.t 4 | 5 | type ctl = { 6 | chan: key (* less: buffer 20? *) Event.channel; 7 | 8 | (* /dev/cons *) 9 | fd: Unix.file_descr; 10 | (* /dev/consctl *) 11 | consctl: Unix.file_descr; 12 | } 13 | 14 | (* will create a keyboard thread reading ctl.fd and sending keys on 15 | * ctl.chan 16 | *) 17 | val init: -> ctl 18 | 19 | val receive: ctl -> key Event.event 20 | --------------------------------------------------------------------------------