first shot of legacybios emulation.

does not work yet.. sorry :-(


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1119 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Stefan Reinauer
2003-09-18 14:16:08 +00:00
parent 59549598c0
commit dcdbdfb46e
51 changed files with 27688 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/*
* bin2hex - binary to hexadecimal converter
*/
#include <stdio.h>
/* 8 values per line */
#define SPLIT 8
int main(int argc, char **argv)
{
int c, i;
i = 0;
while ((c = getchar()) != EOF) {
if ((i % SPLIT) != 0) {
putchar(' ');
}
printf("0x%02x,", c);
i++;
if ((i % SPLIT) == 0) {
putchar('\n');
}
}
putchar('\n');
return 0;
}
// tag: bin2hex

View File

@@ -0,0 +1,68 @@
#!/bin/sh
#
# Copyright (C) 2003 Stefan Reinauer
#
# See the file "COPYING" for further information about
# the copyright and warranty status of this work.
#
# tag: target system test script.
if [ "$CC" == "" ]; then
CC=gcc
fi
echo "void *pointersize;" > types.c
${CC} -c -o types.o types.c
PTRSIZE=$(( 8 * 0x`nm types.o| grep pointersize | cut -f1 -d\ ` ))
rm -f types.c types.o
case "$PTRSIZE" in
32) cell="int32_t "; ucell="uint32_t ";
dcell="int64_t "; ducell="uint64_t"
;;
64) cell="int64_t "; ucell="uint64_t "
dcell="__int128_t "; ducell="__uint128_t"
;;
*) echo "Unsupported ${PTRSIZE}bit platform. please report."; exit 1 ;;
esac
echo -e "found ${PTRSIZE}bit platform, creating \"types.h\""
echo "/* tag: data types for forth engine
*
* This file is autogenerated by types.sh. Do not edit!
*
* Copyright (C) 2003 Patrick Mauritz, Stefan Reinauer
*
* See the file \"COPYING\" for further information about
* the copyright and warranty status of this work.
*/
#ifndef __TYPES_H
#define __TYPES_H
#include <stdint.h>
/* cell based types */
typedef $cell cell;
typedef $ucell ucell;
typedef $dcell dcell;
typedef $ducell ducell;
#define bitspercell (sizeof(cell)<<3)
#define bitsperdcell (sizeof(dcell)<<3)
/* size named types */
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef char s8;
typedef short s16;
typedef int s32;
#endif" > types.h.new
test -r types.h || mv types.h.new types.h