KRInstall KRScript 0.1

Справочник KRScript

Оригинальное руководство сборки на английском. Русскоязычные примеры доступны в разделе KRScript.

KRScript is the application language for Kedr Native x86-64. A .krs file is plain ASCII source. The native shell compiles it to stack instructions and executes it in the guest. No host interpreter or runtime is needed. The compiler and VM are in src/krscript.h. Checked arithmetic uses the kr_integer_math routine in src/native_cpu.asm. This document describes the implemented subset. Use KRScript for new non-kernel applications.

In the shell, help commands lists the built-in commands and bundled apps. Type help NAME for a description and an example, such as help edit or help vetka. Use help jobs or help files for the related commands together.

Start in the terminal

The path between the colon and > in the prompt is your current directory. pwd prints it. cd /home opens the home directory, cd .. opens its parent. ls lists entries. Kedr paths start at / and use forward slashes.

Run ./cdc or /bin/cdc to execute a KRScript file directly. The extension is optional. A bare command name searches PATH from left to right after built-in commands and bundled applications. The initial PATH is /bin. Use command -v cdc to print the chosen path. Use export PATH=/home:/bin to search /home first. Empty path components are skipped. Use export REPORT="daily report" in the shell and getenv("REPORT") in a program. Unset variables return "". The environment lasts one session. cdc "report file.txt" passes a single argument; cdc "" passes an empty one. The first line of an executable can be #!/bin/krs. A different absolute interpreter path selects that KedrFS program and passes it the script path as its first argument. Use firstDiff(pathA, pathB) for a byte-wise file comparison. It returns the first differing offset or -1 for identical files. sortedFile(path) returns lines in byte order, with an LF after each line. emit(value) writes to stdout without appending a newline. print(value) adds a newline. eprint(value) writes a line to stderr.

Run a program with its three streams connected to separate files:

run /home/report.krs <"/home/input file" >/home/report.txt 2>/home/errors.txt
echo $?

Use >> to append stdout. Redirected output is buffered until the command finishes. The size limit per KedrFS file is 32 KiB. stdout and stderr can be redirected to different files. The literal bodies of the shell commands write and append can contain < and > as ordinary characters.

Pipe a program's stdout into the next program's stdin with |. Each stage finishes before the next one starts. The intermediate limit is 32 KiB. cat, grep, wc and sort accept piped input. stderr keeps its own destination. An explicit file redirection takes priority over the pipe.

cat /home/report.txt | grep error | sort | wc
grep done /home/report.txt && echo found || echo missing
echo /home/*.krs
echo "Total: $(cat /home/report.txt | wc)"

The last stage sets the pipeline status. && and || use that status from left to right and skip unused commands. Ctrl+C stops the entire chain. Unquoted * and ? match names in the last path component in byte order; when there are no matches, the pattern is passed as written. Quote a pattern to pass it literally. Command substitution removes trailing LF. Double quotes keep a substitution together as one argument, single quotes keep it literal, and unquoted whitespace separates its fields. Shell command chains allow 64 stages and four nested substitutions.

Processes and jobs

Each KRScript launch gets a positive PID, its own bytecode, variables, stack, string pool, arguments, environment and starting directory. pid() returns its PID. sleep(ms) suspends execution for 0 to 86400000 milliseconds. For example, put this in /home/timer.krs:

sleep(3000);
print("timer " + pid());
exit(17);

Run /home/timer.krs & or spawn /home/timer.krs. Use the number printed after Started PID for these commands:

ps            List state, accumulated VM time and used VM bytes
top           Sample VM execution and IDE activity for 250 ms
joblog PID    Read the background output collected so far
wait PID      Wait, print output and return the program's status
kill PID      Stop a job; wait reports 143
fg PID        Resume with the keyboard and display attached
bg PID        Resume a stopped job in the background

Ctrl+Z suspends a foreground script during computation, sleep or terminal input. Resuming with fg preserves a partly typed line. Programs requiring terminal input or editor services stop when run in the background. Jobs with redirected streams and fullscreen editing do not support Ctrl+Z. For native shell commands and blocking device calls, scheduling points are limited. The shell and VM cooperatively run up to eight script processes. Each background job buffers up to 32 KiB of combined stdout and stderr. Completed jobs are collected by wait or fg; when all slots are occupied, a new launch can reuse the oldest completed job. PIDs are not reused during this boot. top reports VM CPU share, logical VM storage in use, KedrFS file bytes, and cumulative completed IDE read and write bytes.

Read this guide with: more /home/README.md The pager accepts Space or Enter to advance and Esc or q to leave. On the host the same document is in KRScript/README.md.

Run edit /home/hello.krs to open the full-screen KRScript editor. Type or paste these lines literally. Use Enter between lines:

let name = arg(0);
if (name == "") { name = "world"; }
print("Hello " + name);

Ctrl+S saves, Ctrl+F searches, Ctrl+X closes. Type run /home/hello.krs Ada at the shell. Expected output: Hello Ada. Ctrl+Shift+C/V copy and paste text. Shift+Left/Right selects; Ctrl+A selects all. Ctrl+Shift+Z/Y undo and redo. The editor accepts printable ASCII, tabs and newlines. ledit FILE opens the older line-command editor.

You can also type the following directly into the shell:

write /home/hello.krs "let name = arg(0);
print("Hello " + name);
"

The last quote and Enter commit the whole body. Newlines and inner quotes are preserved, including the newline immediately before the closing quote. Esc cancels before commit. Use sync to persist shell writes. In a running Windows preview, place a script in Windows-USB and use import /usb/windows/hello.krs /home/copy.krs to copy it into Kedr. In the Windows launcher, cd /usb/windows/ opens the shared folder. Use ls to list it, play music.mp3 to stream a track by name, and cd .. to return to /usb. Use a path in /home as the destination for imports.

Lexical rules

Names are case-sensitive ASCII letters, digits and underscores. The first character must be a letter or underscore. Maximum name length: 47 bytes. Whitespace separates tokens. // starts a comment through the end of line. Keywords are let, if, else, while, fn and return. Put a semicolon after variable declarations, assignments and function call statements. Do not put one after a block. Use braces for every conditional or loop body, even for one statement.

Grammar

program     = (statement | definition)* EOF
definition  = "fn" NAME "(" [ NAME ("," NAME)* ] ")" block
statement   = "let" NAME "=" expression ";"
            | NAME "=" expression ";"
            | call ";"
            | "return" [ expression ] ";"       // inside a function
            | "if" "(" expression ")" block [ "else" block ]
            | "while" "(" expression ")" block
block       = "{" statement* "}"
call        = NAME "(" [ expression ("," expression)* ] ")"
primary     = INTEGER | STRING | NAME | call | "(" expression ")"
unary       = ("-" | "!") unary | primary
expression  = unary with binary operators in the precedence order below

There are two value types, signed 32-bit integers and byte strings. Variables can change type on assignment. A top-level let declares a global. Parameters and variables declared in a function belong to that invocation. They can shadow globals. Braces do not introduce another variable scope. Declare variables before use. A global used in a function must appear before its definition. Variables start at integer 0, including declarations inside a skipped branch. Each program starts with a fresh set of globals.

Functions can call themselves and each other, including functions defined later in the file. The compiler checks names and argument counts before executing any statements. A bare return, or reaching the end of a function, returns 0. Strings and integers can both be returned.

print(fact(5));
fn fact(n) {
    if (n < 2) { return 1; }
    return n * fact(n - 1);
}

This prints 120. A program may define 48 functions. Each function has up to 64 parameter and variable slots combined. A process has up to 32 active function calls sharing 256 local slots and its existing operand stack.

Debug a program

debug /home/example.krs stops before the first executable statement and prints its PID. Substitute that number and the desired source line:

breakpoint PID LINE     Pause when execution reaches that statement
vars PID                Inspect globals and the current call's locals
step PID                Execute up to the next statement, entering calls
continue PID            Resume until a breakpoint or program exit
unbreak PID LINE        Remove the breakpoint

Line numbers start at 1. A declaration header, blank line or comment alone cannot hold a breakpoint. Each debug process supports eight breakpoint lines. vars labels local and global values separately and shows the initial zero for variables whose initializer has not yet executed.

Integer literals are decimal from 0 to 2147483647. Use unary minus for negative numbers. Arithmetic outside the signed 32-bit range is an error. Strings use double quotes. Escapes include newline (\n), tab (\t), double quote (\") and backslash (\\). Do not embed literal line breaks or NUL bytes in strings. Use ASCII for portable terminal output.

Expressions

Precedence from highest to lowest:

unary - !
* / %
+ -
< <= > >=
== !=
&&
||

Binary operators of the same precedence associate left to right. Division truncates toward zero. Division or remainder by zero stops the program. If either operand of + is a string, + concatenates their text. Ordering requires integers. Equality compares strings by contents and integers by value. Values of different types compare unequal. Comparisons produce 1 or 0. Empty strings and zero are false; all other values are true. && and || short-circuit and yield 1 or 0.

let n = 3;
let total = 0;
while (n > 0) {
    total = total + n;
    n = n - 1;
}
print("Total: " + total);

Output: Total: 6

Built-in functions

print(value)             Print a value followed by newline. Returns 0.
argc()                   Number of command arguments (excludes path).
arg(index)               Zero-based argument. Missing index gives "".
input(prompt)            Read a line. On the keyboard, Enter submits up
                         to 127 printable bytes. A redirected text file
                         supplies a line without printing the prompt.
eof()                    True at the end of redirected stdin. An empty
                         line before the end of the file is still data.
eprint(value)            Write a line to stderr.
exit(code)               Finish with integer status 0..255.
num(value)               Parse a signed decimal integer. Invalid input
                         raises an error. Magnitude limit: 2147483647.
str(value)               Convert an integer to decimal or keep a string.
len(text)                Byte length of the text representation.
slice(text,start,count)  Substring, zero-based byte index. A count past
                         the end is clipped. Negative bounds or a start
                         past the end are errors.
index(text,needle)       First byte offset or -1. Empty needle gives 0.
exists(path)             1 for an existing file or directory, else 0.
read(path)               Read a text file. An unknown path is an error.
write(path,text)         Create or replace a text file. Returns 0.
append(path,text)        Append bytes, creating a missing file. Returns 0.
fail(message)            Stop the current program and report the message.

Functions have exact arity. Use read/write/append for text. Writes have the same permissions and size limits as shell writes. A failed program does not roll back earlier writes. Relative paths use the shell directory. Use shell quotes to pass an argument containing spaces. Ctrl+C interrupts a foreground script; echo $? then prints 130. A missing command returns 127.

The bundled edit.krs uses these kernel text-editor services:

docOpen(path)   Open an ASCII text buffer, including a new document.
docDraw(msg)    Draw the current buffer and optional status message.
docKey()        Wait for input; returns save, quit, find, yes, no or edit.
docApply()      Apply the last input event; returns a filesystem status.
docSave()       Write the file and sync a mounted KedrFS disk.
docDirty()      Return 1 when the text differs from the last save.
docFind()       Read a search term; select the next match, wrapping once.
docClose()      Release the buffer and redraw the shell.

Only one document is active. Text and the clipboard are limited to 32 KiB. docKey starts a new instruction-budget slice after a user event.

if (argc() != 1) { fail("Pass one filename"); }
let path = arg(0);
if (exists(path)) {
    print(read(path));
} else {
    write(path, "First entry\n");
    print("Created " + path);
}

Byte buffers and graphics

bufNew(size)             Allocate a zeroed byte buffer; returns an integer handle.
bufLen(handle)           Get the size. A process can own four buffers of 1..4096 bytes.
bufGet(handle,index)     Read a byte at a zero-based index.
bufSet(handle,index,v)   Write an integer byte from 0 to 255.
bufFill(handle,v)        Set every byte to the same value.
bufFree(handle)          Release the buffer. Its handle becomes invalid.
frameShow(handle,w,h)    Present w*h bytes in row order. Maximum size: 64 by 48.
frameKey()               Wait for a key in the foreground window.
frameEvent()             Wait for a keyboard or three-button PS/2 mouse event.
frameClose()             Restore the text terminal.

Handles are local to the allocating process. Invalid handles, indexes and sizes stop the offending program. Colours use RGB332: the upper three bits are red, the next three green, and the low two blue. One sample occupies a 3x3 block on screen. Esc is 27. Left, right, up and down are 256, 257, 258 and 259. Ctrl+C interrupts the application. The frame is a copy of the submitted pixels. frameEvent returns the same codes as frameKey for keys. For mouse events it returns 16777216 + buttons*65536 + y*256 + x. Coordinates start at the centre of a new frame and stay within its bounds. In the button mask, 1 means left, 2 right and 4 middle. A release clears its bit. Each report contains current button state. Older reports may be dropped if the program falls more than 64 reports behind. Switching back to a window discards mouse input received during its absence. A program can draw its own cursor.

let b = bufNew(256);
frameShow(b, 16, 16);
let e = frameEvent();
if (e >= 16777216) {
    let x = e % 256;
    let y = (e / 256) % 256;
    bufSet(b, y * 16 + x, 255);
    frameShow(b, 16, 16);
    frameKey();
}
frameClose();
bufFree(b);

For a runnable example: kri install palette, then palette.

Programs and tools

Run kri list for the signed public catalogue at krinstall.nurugram.ru. Use kri install NAME, kri update NAME and kri remove NAME. kri installed lists local packages. kri rollback reverts the last package update transaction. The network client checks RSA-2048/SHA-256 against its built-in repository public key for both packages and dependencies.

Build a reusable command inside Kedr:

build /home/cdc.krs /bin/cdc
cdc 21
pack /bin/cdc /home/cdc.kpkg
sync

build compiles without running the program. It writes KRB1 bytecode with source line numbers and variable names for the debugger. The command can run after a reboot even when its source has been removed. A compile error leaves the previous executable intact. The build output and the entire package must each fit in one 32 KiB KedrFS file.

To transfer the package, shut down the source guest after sync. In the Kedr16 directory on Windows run:

python export_package.py native-data.img /home/cdc.kpkg cdc.kpkg

The exporter reads a saved snapshot and creates a new host file. Put the package in Windows-USB beside the destination VM launcher and run in Kedr:

pkg install /usb/windows/cdc.kpkg
command -v cdc
cdc 21
sync

KPK1 carries one compiled command. Installation checks the package CRC, the bytecode and the command name before creating /bin/cdc. An occupied name is reported as an error. The CRC detects corruption; it does not authenticate the publisher.

For versioned packages, append a positive integer version and, optionally, up to eight dependencies to the pack command. Each dependency uses the form name@minimum_version. For example:

pack /bin/base /home/base.kpkg 2
pack /bin/cdc /home/cdc.kpkg 3 base@2

Export the .kpkg files and put them in the same directory on the target. Use the dependency's exact name followed by .kpkg for its filename.

pkg install /usb/windows/cdc.kpkg
pkg list
pkg update /usb/windows/cdc.kpkg
pkg remove cdc
pkg remove base

update expects a newer version than the installed one. install and update validate all required versions, bytecode, space and cycles before changing the in-memory filesystem. One transaction can install or replace up to twelve packages. Run sync to persist it. Removing a required package is blocked until its dependent packages have been removed.

KPK1 packages have version 1 and no dependencies. To manage a bare command installed by an older Kedr build, use pkg adopt FILE.kpkg. Adoption requires byte-for-byte equality with the installed executable.

Updates require RSA-2048/SHA-256 signatures (PKCS#1 v1.5). The trusted public modulus comes from KEDRKEY.BIN on the boot volume. With a key provisioned, install, adopt, update and every staged dependency verify the entire package against its adjacent FILE.kpkg.sig before committing. Without a key, initial installation remains available. Replacing an installed package requires a valid boot key. The host-side publisher instructions are in the project README.

pkg rollback restores the last package update transaction, including dependency versions and removal of packages first added by that update. Use sync to persist both the update and its checkpoint. The next update replaces that checkpoint. Rollback checks the recorded file hashes and the resulting dependency graph, and refuses to overwrite later changes.

Backups

In Windows run python make_backup.py in the Kedr16 directory, then start the VM to attach native-backup.img. Run backup inside Kedr. This copies the current KedrFS tree to the dedicated marked disk, retaining up to two generations, and verifies the newly written snapshot. With the VM off you can transfer that image to another Kedr installation. To restore a file:

restore "/home/old file" "/home/recovered file"
sync

The source is an absolute path in the latest valid snapshot. The destination must be new and its parent directory must already exist. The backup covers KedrFS files, including binary contents. External mounts and live process state are separate.

If Kedr finds its marked primary disk but cannot load either snapshot, it starts the recovery console at rescue>. Run fsck primary and fsck backup to inspect both slots on each disk. These checks only read data. With a marked backup attached, recover backup restores the newest valid backup generation to the damaged primary disk, verifies it by reading it back, and opens the normal shell. Use cat to check your recovered files.

To create a bootable disk image on the PC, run this in the Kedr16 folder:

python install_image.py kedr.img

Use a new file name. Boot the image as a primary IDE disk with x64 UEFI to save changes on its KedrFS partition. Booting it as USB alone starts a temporary RAM filesystem; status shows the active storage mode.

run /home/hello.krs Ada     Compile and run a file
budget add 25 train ticket Append a whole-unit expense
budget list                Display expense records
budget total               Sum all expenses
note buy new batteries     Append a note
note                       Read the notebook
convert 25 c2f             Integer temperature conversion
convert 5 mi2km            Integer distance conversion
source budget              Show the bundled .krs source

Bundled source on the PC is in programs/*.krs. The build embeds this source in the boot image, so bundled tools work with an existing data disk. Applications use the same compiler as the run command. To add a bundled tool, put NAME.krs in programs/ and run build.cmd. A user script needs no rebuild: enter it with edit, then use run.

Limits and diagnostics

Vetka and media

For local terminal windows, type vetka. F1 through F4 select a window. Use play /usb/windows/music.mp3 in the first one, press F2 and run edit /home/demo.krs. Ctrl+S saves the document. Return with F1. Press Esc at the player's empty prompt to stop audio. vetka list shows the selected window and the audio owner. Windows last until reboot.

In the Windows launcher, view and play take the original shared file name, for example view /usb/windows/photo.jpeg or play /usb/windows/song.flac. The host prepares common compressed media formats. Kedr renders the photo in RGB332, up to 64 by 48 samples shown as three-pixel squares, and plays mono, 12 kHz, 8-bit-quantized audio. Originals are read-only.

Startup services and system journal

Register an existing KRScript source or compiled program by absolute path:

service enable worker "/home/my worker.krs"
sync
service start worker
service list
service restart worker
service stop worker
service disable worker
sync

Enable registers a service for future normal boots. Start launches it now with / as its working directory. Only one live process per name is allowed. Stop leaves the registration enabled. Disable removes it and stops any live instance. A failed or completed program stays stopped until manually started or the next normal boot. Services share the eight KRScript process slots. Use joblog PID for program output and ps for process state. Registration files under /services are part of KedrFS backups.

Scheduled tasks

schedule after remind 10 "/home/remind me.krs"
schedule every report 60 /home/report.krs
schedule list
journal schedule
schedule remove report

Create the program first. A timer takes a name, a delay in seconds (1 to 2592000), and an absolute program path. Up to eight timers can be registered. Tasks use the shared process table, run in / with PATH=/bin and no arguments. Use ps and joblog PID to inspect a running task and its buffered output. Removing a timer cancels future launches; use kill PID to stop a current run.

An after timer belongs to this session and makes one launch attempt. An every timer stores a registration under /schedules. Use sync after adding or removing a recurring timer to persist the change. After boot its first run is due after one full interval. Timers use monotonic uptime. The cooperative scheduler runs a due task when the shell or VM next polls, coalesces missed intervals and skips a run if the previous instance is still active. Errors and skips appear in journal schedule. No jobs run while the machine is powered off.

The journal command prints up to 64 events from the current boot in time order. Each row includes milliseconds since boot, source and severity. Use journal kernel, journal driver or journal service to filter events. The recovery console also supports journal. Use journal > /home/boot.log and sync in the normal shell to keep a copy.

There are 64 variable slots, up to 32 arguments, 96 operand stack slots, 4095 usable instructions including the stop instruction, and a 40000-step execution budget. Expression depth is limited to 48 and block depth to 32. String literals and newly produced strings share a 64 KiB arena. It is released at the end of each run. Prefer short inputs and avoid growing strings indefinitely in loops. Each filesystem entry holds at most 32768 bytes. The language offers no raw pointers, port I/O or calls to arbitrary machine addresses.

Syntax is checked before any statement runs. Runtime errors stop only the script. The terminal reports KRScript, a 1-based source line, and a diagnostic, for example Expected semicolon, Unknown variable, Division by zero or Instruction limit reached. Use errors to see recent messages. Use errors list and errors demo script to preview error categories.

Accounts and protected operations

The first boot asks for a new root password and an ordinary account. There are no default credentials. Passwords contain 8-64 printable ASCII characters and are confirmed without echo. Every later boot requires the root password to unlock Kedr, then a login name and that account's password. Losing the root password prevents normal boot. A malformed account database locks the shell. Recovery boot also stays locked when the primary account database is unreadable.

Use whoami and users to inspect identity. su root changes to root after a password check. su NAME changes to another account after that account's check. login and logout provide an interactive login. Switching accounts clears all terminal windows, editors, aliases, history and foreground/session jobs. Services and scheduled tasks keep their root identity. Save edits beforehand. Use sudo COMMAND for one ordinary shell command with the root password. sudo accepts a single command with arguments. Pipes and redirection belong to the calling shell and retain its permissions. Account operations require direct interactive input and are unavailable inside scripts or redirected input.

Root creates accounts with useradd NAME. passwd changes your password after checking the old one. Root may use passwd NAME. Up to eight accounts are supported, including root. users displays the fixed root and users groups. Passwords use PBKDF2-HMAC-SHA256 with a separate 16-byte salt and 100000 rounds. The /.users record is protected by the guest filesystem access checks. The disk remains unencrypted. Offline disk or boot-image modification can bypass this software access control. Hardware process isolation and full-disk encryption are separate, unfinished features.

Ordinary accounts read public system files and write inside /home/NAME. Other users' home directories, /root and internal top-level dot paths are inaccessible. Root owns the remaining system tree. Files inherit the policy of their directory. Arbitrary chmod/chown permissions are not implemented. PATH starts with the current user's home/bin directory, followed by /bin. Existing files in /home stay in place and remain readable. Copy your files into your home directory to edit them as an ordinary user.

System package changes, network configuration, services, scheduling, backups, restore, shutdown and reboot require root. Package listing remains public. Programs inherit the launching UID. Processes cannot control another user's PID. File writes, editor saves and KRScript file functions enforce the same rules. sync saves pending changes without granting access to protected files.

System commands from KRScript

system(command) runs one Kedr command under the calling program's UID and returns its exit status. It supports the command's normal quoted arguments. It does not parse shell pipelines or redirects. Output goes to the program's current output stream. Nested system calls are rejected. A background process stops before a system call until it is resumed with fg. user() returns the current account name. The program's working directory and environment follow successful cd and export commands. These calls also support filesystem tools, package operations, network downloads, process launch and application builds, subject to the same permissions and supported hardware as the shell.

print(user());
let result = system("mkdir notes");
write("notes/hello.txt", "Hello from KRScript");
print(system("cat notes/hello.txt"));

Multi-file KRA1 applications

A .kra contains a compiled main.krb entry point plus source files and resources. Create a project directory containing main.krs, then build it entirely inside Kedr. Nested directories are supported. The output must be outside the project.

mkdir project
mkdir project/assets
write project/main.krs print(appRead("assets/message.txt"));
write project/assets/message.txt Hello from my application
kra build project demo.kra
kra list demo.kra
run demo.kra

All files are packed into the application. appFiles() returns their relative names separated by newlines. appRead(path) returns a text resource and rejects embedded zero bytes. appSize(path) returns a byte count. appByte(path,offset) reads a binary byte with bounds checking. Resources are immutable per-process copies, so replacing a package cannot change a running application's assets. Use normal write() for mutable user data in the user's home directory.

The archive allows 16 files including main.krb, up to 63 bytes per relative path and 31 bytes per path component, and 32 KiB total. Traversal components, duplicate names, invalid CRCs, trailing data and malformed bytecode are rejected. The original main.krs is included as a resource. Source and string limits of the KRScript VM still apply. A build failure preserves the previous output.

To install by command name, build to bin/demo in your home, then use pack. KPK1/KPK2 accept either KRB1 bytecode or a KRA1 payload. Root installs system packages. Dependencies, signatures, update rollback and old packages continue to use the existing package manager. The installer lists each package and its bundled files and displays installation progress. kri install downloads and verifies the entire dependency transaction before committing it.

kra build project bin/demo
pack bin/demo demo.kpkg 1
sudo pkg install /home/NAME/demo.kpkg
demo

KRA1 starts with eight bytes KRA1, NUL, CR, LF, SUB. A little-endian CRC32 of bytes 16 onward and a u32 file count follow. Each record contains a NUL-padded 64-byte relative name, a little-endian u32 size and that many bytes. The entry named main.krb contains the standard KRB1 program. KRA1 is Kedr's own format.