Added some missing CVS headers and did a bit of cleaning up.
This commit is contained in:
parent
478d0b1d8a
commit
c40a44b52e
15 changed files with 31 additions and 87 deletions
|
@ -1,5 +1,6 @@
|
||||||
# $Source$
|
# $Source$
|
||||||
# $State$
|
# $State$
|
||||||
|
# $Revision$
|
||||||
|
|
||||||
The pc86 platform
|
The pc86 platform
|
||||||
=================
|
=================
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#
|
#
|
||||||
! $Source$
|
! $Source$
|
||||||
! $State$
|
! $State$
|
||||||
|
! $Revision$
|
||||||
|
|
||||||
! Declare segments (the order is important).
|
! Declare segments (the order is important).
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
# $Source$
|
||||||
|
# $State$
|
||||||
# $Revision$
|
# $Revision$
|
||||||
|
|
||||||
var w=2
|
var w=2
|
||||||
var p=2
|
var p=2
|
||||||
var s=2
|
var s=2
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#
|
#
|
||||||
! $Source$
|
! $Source$
|
||||||
! $State$
|
! $State$
|
||||||
|
! $Revision$
|
||||||
|
|
||||||
! Declare segments (the order is important).
|
! Declare segments (the order is important).
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#
|
#
|
||||||
! $Source$
|
! $Source$
|
||||||
! $State$
|
! $State$
|
||||||
|
! $Revision$
|
||||||
|
|
||||||
! Declare segments (the order is important).
|
! Declare segments (the order is important).
|
||||||
|
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
/* $Source$
|
||||||
|
* $State$
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#
|
#
|
||||||
! $Source$
|
! $Source$
|
||||||
! $State$
|
! $State$
|
||||||
|
! $Revision$
|
||||||
|
|
||||||
! Declare segments (the order is important).
|
! Declare segments (the order is important).
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#
|
#
|
||||||
! $Source$
|
! $Source$
|
||||||
! $State$
|
! $State$
|
||||||
|
! $Revision$
|
||||||
|
|
||||||
! Declare segments (the order is important).
|
! Declare segments (the order is important).
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* $Source$
|
||||||
|
* $State$
|
||||||
|
* $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* $Source$
|
||||||
|
* $State$
|
||||||
|
* $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#
|
#
|
||||||
! $Source$
|
! $Source$
|
||||||
! $State$
|
! $State$
|
||||||
|
! $Revision$
|
||||||
|
|
||||||
! Declare segments (the order is important).
|
! Declare segments (the order is important).
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* $Source$
|
||||||
|
* $State$
|
||||||
|
* $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef LIBSYS_H
|
#ifndef LIBSYS_H
|
||||||
#define LIBSYS_H
|
#define LIBSYS_H
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
-- $Source$
|
-- $Source$
|
||||||
-- $State$
|
-- $State$
|
||||||
|
-- $Revision$
|
||||||
|
|
||||||
local d = ROOTDIR.."plat/pc86/libsys/"
|
local d = ROOTDIR.."plat/pc86/libsys/"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
-- $Source$
|
-- $Source$
|
||||||
-- $State$
|
-- $State$
|
||||||
|
-- $Revision$
|
||||||
|
|
||||||
local d = ROOTDIR.."plat/pc86/"
|
local d = ROOTDIR.."plat/pc86/"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue