Added some missing CVS headers and did a bit of cleaning up.

This commit is contained in:
dtrg 2007-02-20 00:31:54 +00:00
parent 478d0b1d8a
commit c40a44b52e
15 changed files with 31 additions and 87 deletions

View file

@ -1,5 +1,6 @@
# $Source$
# $State$
# $Revision$
The pc86 platform
=================

View file

@ -1,6 +1,7 @@
#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).

View file

@ -1,4 +1,7 @@
# $Source$
# $State$
# $Revision$
var w=2
var p=2
var s=2

View file

@ -1,6 +1,7 @@
#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).

View file

@ -1,6 +1,7 @@
#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).

View file

@ -1,87 +0,0 @@
/* There should be a header for brk and sbrk, but there isn't. */
#include <stdlib.h>
#include <errno.h>
/* #include <unistd.h> */
extern char _end[];
static char* brkpointer = _end;
static void prints(char* s)
{
for (;;)
{
char c = *s++;
if (!c)
break;
write(0, &c, 1);
}
}
static void printc(unsigned int n)
{
char c;
n &= 0xF;
if (n < 10)
c = n + '0';
else
c = n + 'A' - 10;
write(0, &c, 1);
}
static void printh(unsigned int n)
{
printc(n>>12);
printc(n>>8);
printc(n>>4);
printc(n);
}
static void waitforkey(void)
{
char c;
read(1, &c, 1);
}
int _brk(char* newend)
{
char dummy;
/* Ensure that newend is reasonable. */
if ((newend < _end) || (newend > (&dummy - 256)))
{
prints("[brk to ");
printh((unsigned int) newend);
prints(" failed]\n\r");
waitforkey();
errno = ENOMEM;
return -1;
}
prints("[brk to ");
printh((unsigned int) newend);
prints("]\n\r");
waitforkey();
brkpointer = newend;
return 0;
}
char* _sbrk(int delta)
{
char* oldpointer = brkpointer;
prints("[sbrk delta ");
printh((unsigned int) delta);
prints(" from ");
printh((unsigned int) oldpointer);
prints("]\n\r");
printh((unsigned int) brkpointer);
prints(" ");
printh((unsigned int) _end);
if (_brk(oldpointer + delta) == -1)
return (char*)-1;
return oldpointer;
}

View file

@ -1,3 +1,7 @@
/* $Source$
* $State$
*/
#include <stdlib.h>
#include <errno.h>
#include <sgtty.h>

View file

@ -1,6 +1,7 @@
#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).

View file

@ -1,6 +1,7 @@
#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).

View file

@ -1,3 +1,8 @@
/* $Source$
* $State$
* $Revision$
*/
#include <stdlib.h>
#include <errno.h>
#include <sgtty.h>

View file

@ -1,3 +1,8 @@
/* $Source$
* $State$
* $Revision$
*/
#include <stdlib.h>
#include <errno.h>
#include <sgtty.h>

View file

@ -1,6 +1,7 @@
#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).

View file

@ -1,3 +1,8 @@
/* $Source$
* $State$
* $Revision$
*/
#ifndef LIBSYS_H
#define LIBSYS_H

View file

@ -1,5 +1,6 @@
-- $Source$
-- $State$
-- $Revision$
local d = ROOTDIR.."plat/pc86/libsys/"

View file

@ -1,5 +1,6 @@
-- $Source$
-- $State$
-- $Revision$
local d = ROOTDIR.."plat/pc86/"