OpenCores
URL https://opencores.org/ocsvn/plasma/plasma/trunk

Subversion Repositories plasma

[/] [plasma/] [trunk/] [tools/] [no_os.c] - Blame information for rev 200

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 137 rhoads
#include "plasma.h"
2
 
3
#define MemoryRead(A) (*(volatile unsigned int*)(A))
4
#define MemoryWrite(A,V) *(volatile unsigned int*)(A)=(V)
5
 
6 200 rhoads
int InitStack[128];  //used by boot.asm
7
 
8 137 rhoads
void putchar(int value)
9
{
10
   while((MemoryRead(IRQ_STATUS) & IRQ_UART_WRITE_AVAILABLE) == 0)
11
      ;
12
   MemoryWrite(UART_WRITE, value);
13
}
14
 
15
int puts(const char *string)
16
{
17
   while(*string)
18
   {
19
      if(*string == '\n')
20
         putchar('\r');
21
      putchar(*string++);
22
   }
23
   return 0;
24
}
25
 
26
void OS_InterruptServiceRoutine(unsigned int status)
27
{
28
   (void)status;
29
   putchar('I');
30
}
31
 
32
int kbhit(void)
33
{
34
   return MemoryRead(IRQ_STATUS) & IRQ_UART_READ_AVAILABLE;
35
}
36
 
37
int getch(void)
38
{
39
   while(!kbhit()) ;
40
   return MemoryRead(UART_READ);
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.