Subversion Repositories SvarDOS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 284 → Rev 285

/website/tech/whatmeans.txt
File deleted
/website/tech/pkgincl.txt
File deleted
/website/tech/vboxfonts.txt
File deleted
/website/tech/pkgformat.txt
File deleted
/website/tech/licensing.txt
File deleted
/website/tech/support.txt
File deleted
/website/index-why.htm
File deleted
/website/help/help-en.amb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/website/index-main.php
1,13 → 1,13
<h1>SvarDOS - an open-source DOS distribution</h1>
<p class="copyr">brought to you by <a href="http://mateusz.viste.fr/" class="mateusz">Mateusz Viste</a></p>
<p class="copyr">for PCs of the 1980-2000 era</p>
 
<div style="margin: 2em auto; width: 21em; border: 1px #777 solid; background-color: #fff; padding: 0.1em 0.5em; color: #a00; font-size: 1.1em;">This project is very much "work-in-progress", not everything works yet!</div>
<div style="margin: 2em auto; width: 21em; border: 1px #777 solid; background-color: #fff; padding: 0.1em 0.5em; color: #a00; font-size: 1.1em; border-radius: 0.3em;">This project is very much "work-in-progress", not everything works yet! Wanna help? Get in touch through the project's mailing list!</div>
 
<p>SvarDOS is an open-source project that is meant to integrate the best out of the currently available DOS tools, drivers and games. DOS development has been abandoned by commercial players a very long time ago, mostly during early nineties. Nowadays, it survives solely through the efforts of hobbyists and retro-enthusiasts, but this is a highly sparse and unorganized ecosystem. SvarDOS aims to collect available DOS software, package it and make it easy to find and install applications using a network-enabled package manager (like apt-get, but for DOS and able to run even on a 8086 PC).</p>
 
<h2>Minimalist and 8086-compatibe</h2>
<h2>Minimalist and 8086-compatible</h2>
 
<p>Once installed, SvarDOS is a minimalistic DOS system that offers only the most basic tools for system administration. It is up to the user to install additional packages. Care is taken so SvarDOS remains 8086-compatible, at least in its most basic (core) configuration.</p>
<p>Once installed, SvarDOS is a minimalistic DOS system that offers only the FreeDOS kernel and the most basic tools for system administration. It is up to the user to install additional packages. Care is taken so SvarDOS remains 8086-compatible, at least in its most basic (core) configuration.</p>
 
<h2>Open-source</h2>
 
15,11 → 15,11
 
<h2>No "versions"</h2>
 
<p>SvarDOS is a "rolling" release, meaning that it doesn't follow the concept of "versions". Once the system is installed, its packages can be kept up-to-date using the SvarDOS online update tools (pkgnet &amp; pkginst).</p>
<p>SvarDOS is a "rolling" release, meaning that it doesn't follow the concept of "versions". Once the system is installed, its packages can be kept up-to-date using the SvarDOS online update tools (pkg &amp; pkgnet).</p>
 
<h2>Community and help</h2>
 
<p>Need to get in touch? Wish to submit some packages, translate SvarDOS to your language, or otherwise contribute? Or maybe you'd like some information about SvarDOS? The project has a <a href="https://lists.osdn.me/mailman/listinfo/svardos-users">mailing list</a> just for that.</p>
<p>Need to get in touch? Wish to submit some packages, translate SvarDOS to your language, or otherwise contribute? Or maybe you'd like some information about SvarDOS? The project has a <a href="https://lists.osdn.me/mailman/listinfo/svardos-users">mailing list</a> just for that. You may also wish to take a look at the <a href="phpamb.php?fname=help/help-en.amb&amp;f=todo.ama">project's "todo list"</a>.</p>
 
<h2>Downloads</h2>
 
/website/index-repo.php
1,5 → 1,5
<h1>SvarDOS repository</h1>
<p class="copyr">or the world of packages</p>
<p class="copyr">"the world of packages"</p>
 
<p>This page lists all packages that are available in the SvarDOS repository. These packages can be downloaded from within SvarDOS using the pkgnet tool, or you can download them from here.</p>
 
/website/index.php
10,7 → 10,7
</head>
<body>
 
<p style="margin: 0 0 -1em auto; font-size: 0.9em; text-align: right;"><a href="/">Main page</a> I <a href="?p=why">Why SvarDOS</a> I <a href="?p=repo">Repo</a> I <a href="?p=tech">Tech</a> I <a href="?p=nls">NLS</a></p>
<p style="margin: 0 0 -1em auto; font-size: 0.9em; text-align: right;"><a href="/">Main page</a> I <a href="?p=repo">Repo</a> I <a href="phpamb.php?fname=help/help-en.amb">Help</a><!-- I <a href="?p=nls">NLS</a>--></p>
 
<?php
 
17,11 → 17,7
$p = '';
if (! empty($_GET['p'])) $p = $_GET['p'];
 
if ($p == 'why') {
readfile('index-why.htm');
} else if ($p == 'tech') {
include 'index-tech.php';
} else if ($p == 'nls') {
f ($p == 'nls') {
readfile('index-nls.htm');
} else if ($p == 'repo') {
include 'index-repo.php';
/website/phpamb.css
0,0 → 1,64
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');
 
html {
background-color: #eee;
}
 
body {
font-size: 1.2em;
font-family: 'Roboto Mono', monospace;
width: 78ch;
background-color: #fff;
margin: 0 auto;
padding: 0.5em;
padding-top: 0;
white-space: pre;
border: 1px #aaa solid;
}
 
h1 {
font-size: 1em;
font-weight: bold;
display: inline;
}
 
a {
color: #00f;
text-decoration: none;
}
 
a:hover {
color: #fff;
background-color: #44f;
}
 
a.liketext, a.liketext:hover {
color: inherit;
background-color: inherit;
font-size: inherit;
font-weight: inherit;
text-decoration: inherit;
}
 
div {
margin: 0 -0.5em;
padding: 0 0.5em;
display: flex;
justify-content: space-between;
background-color: #666;
}
 
span {
color: #eee;
margin: 0;
padding: 0;
}
 
span.notice {
color: #330;
background-color: #f70;
}
 
span.boring {
color: #888;
}
/website/phpamb.php
0,0 → 1,192
<?php
// php reader of AMB files -- turns an AMB book into a web page
//
// Copyright (C) 2020 Mateusz Viste
// http://amb.osdn.io
//
// MIT license
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
 
$VERSION = "20201218";
 
function getamafile($ambfname, $amafname) {
if (! is_file($ambfname)) return(FALSE);
$fd = fopen($ambfname, "rb");
if ($fd === FALSE) return(FALSE);
// read header (AMB1)
if (fread($fd, 4) !== 'AMB1') return(FALSE);
// read number of ama files inside
$fcount = reset(unpack('v', fread($fd, 2)));
if ($fcount === FALSE) return(FALSE);
// read index until AMA file is found
$offset = 0;
$amalen = 0;
$amafile = '';
for ($i = 0; $i < $fcount; $i++) {
$amafile = rtrim(fread($fd, 12), "\0");
$offset = reset(unpack('V', fread($fd, 4)));
$amalen = reset(unpack('v', fread($fd, 2)));
$bsum = reset(unpack('v', fread($fd, 2)));
if (strcasecmp($amafile, $amafname) == 0) break;
}
if ($i >= $fcount) return(FALSE); // not found
// jump to offset and read file
fseek($fd, $offset);
$result = fread($fd, $amalen);
fclose($fd);
return($result);
}
 
 
// converts str into utf-8 using the unicodemap lookup table and returns the resulting (converted) str
function txttoutf8($str, $unicodemap) {
$s = str_split($str, 1); // convert the string to a table for
$res = '';
foreach ($s as $c) $res .= $unicodemap[ord($c)]; // convert raw characters into HTML unicode codes
return($res);
}
 
 
// MAIN STARTS HERE
 
 
if (empty($_GET['fname'])) {
echo "usage: phpamb.php?fname=file.amb\n";
exit(0);
}
 
$ambfname = $_GET['fname'];
$f = 'index.ama'; // default file
if (! empty($_GET['f'])) $f = $_GET['f'];
 
$title = trim(getamafile($ambfname, 'title'));
if ($title === FALSE) $title = $ambfname;
 
$ama = getamafile($ambfname, $f);
if ($ama === FALSE) $ama = 'ERROR: FILE NOT FOUND';
 
// prepare a 256-entries lookup array for unicode encoding
$unicodemap = array();
for ($i = 0; $i < 128; $i++) $unicodemap[$i] = $i; // low ascii is the same
 
$unicodemaptemp = unpack('v128', getamafile($ambfname, 'unicode.map'));
if ($unicodemaptemp === FALSE) $unicodemaptemp = array_fill(0, 128, 0xfffd);
$unicodemap = array_merge($unicodemap, $unicodemaptemp);
 
/* convert the unicode map so it contains actual html code instead of glyph values */
for ($i = 0; $i < 256; $i++) {
if ($unicodemap[$i] < 128) {
$unicodemap[$i] = htmlspecialchars(chr($unicodemap[$i]), ENT_HTML5);
} else {
$unicodemap[$i] = '&#' . $unicodemap[$i] . ';';
}
}
 
 
// perform UTF-8 conversion of the title
$title = txttoutf8($title, $unicodemap);
 
 
echo "<!DOCTYPE html>\n";
echo "<html>\n";
echo "<head>\n";
echo ' <meta charset="UTF-8">' . "\n";
echo " <title>{$title}</title>\n";
echo ' <link rel="stylesheet" href="phpamb.css">' . "\n";
echo ' <meta name="viewport" content="width=device-width, initial-scale=1">' . "\n";
echo " <meta name=\"generator\" content=\"phpamb/{$VERSION}\">\n";
echo "</head>\n";
echo "<body>";
 
echo "<div><span><a href=\"?fname={$ambfname}\" class=\"liketext\">{$title}</a></span><span>[" . pathinfo($f, PATHINFO_FILENAME) . "]</span></div>\n";
 
/* detect links first, before any htmlization occurs */
$ama = preg_replace('!(https?|ftp)://([-A-Z0-9./_*?&;%=#~:]+)!i', 'LiNkStArTxXx$0LiNkEnDxXx', $ama);
 
$amacontent = str_split($ama, 1);
$escnow = 0; // next char is an escape code
$readlink = 0; // a link target is being read
$opentag = ''; // do I have a currently open html tag?
 
$out = '';
foreach ($amacontent as $c) {
// ignore CR
if ($c == "\r") continue;
// is link target being read?
if ($readlink != 0) {
if (($c == "\n") || ($c == ':')) {
$out .= '">';
$opentag = 'a';
$readlink = 0;
if ($c == ':') continue;
} else {
$out .= urlencode($c);
}
continue;
}
//
if ($escnow != 0) {
if ($c == '%') {
$out .= '%';
} else if ($c == 'l') {
$out .= '<a href="' . $_SERVER['PHP_SELF'] . "?fname={$ambfname}&amp;f=";
$readlink = 1;
} else if ($c == 'h') {
$out .= '<h1>';
$opentag = 'h1';
} else if ($c == '!') {
$out .= '<span class="notice">';
$opentag = 'span';
} else if ($c == 'b') {
$out .= '<span class="boring">';
$opentag = 'span';
}
$escnow = 0;
continue;
}
// close </a> if open and got LF or new tag
if ((!empty($opentag)) && (($c == "\n") || ($c == "%"))) {
$out .= "</{$opentag}>";
$opentag = '';
}
//
if ($c == '%') {
$escnow = 1;
} else {
$out .= $unicodemap[ord($c)]; // convert characters into HTML unicode codes
}
}
 
// close open tags
if (!empty($opentag)) {
$out .= "</{$opentag}>";
$opentag = '';
}
 
/* postprocessing: find links detected earlier and change them to proper anchors */
$out = preg_replace('/LiNkStArTxXx.*LiNkEnDxXx/', '<a href="$0">$0</a>', $out);
$out = preg_replace('/(LiNkStArTxXx)|(LiNkEnDxXx)/', '', $out);
 
echo $out;
 
echo "</body>\n";
echo "</html>\n";
 
?>