Пример #1
0
Error VGA::initialize()
{
    CoreMessage mem;

    /* Request VGA memory. */
    mem.action    = CreatePrivate;
    mem.size      = PAGESIZE;
    mem.virt      = ZERO;
    mem.phys      = VGA_PADDR;
    mem.access    = Memory::Present |
                    Memory::User |
                    Memory::Readable |
                    Memory::Writable |
                    Memory::Pinned;
    mem.type      = IPCType;
    IPCMessage(CORESRV_PID, API::SendReceive, &mem, sizeof(mem));

    /* Point to the VGA mapping. */
    vga = (u16 *) mem.virt;

    /* Clear screen. */
    for (uint i = 0; i < width * height; i++)
    {                                                  
        vga[i] = VGA_CHAR(' ', LIGHTGREY, BLACK);
    }
    
    /* Disable hardware cursor. */
    WriteByte(VGA_IOADDR, 0x0a);
    WriteByte(VGA_IODATA, 1 << 5);
    
    /* Successfull. */
    return ESUCCESS;
}
Пример #2
0
Error VGA::initialize()
{
    MemoryMessage mem;

    /* Request VGA memory. */
    mem.action    = CreatePrivate;
    mem.bytes     = PAGESIZE;
    mem.virtualAddress  = ZERO;
    mem.physicalAddress = VGA_PADDR;
    mem.protection      = PAGE_RW | PAGE_PINNED;
    mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));

    /* Point to the VGA mapping. */
    vga = (u16 *) mem.virtualAddress;

    /* Clear screen. */
    for (uint i = 0; i < width * height; i++)
    {                                                  
        vga[i] = VGA_CHAR(' ', LIGHTGREY, BLACK);
    }

    /* Request CRT I/O ports. */
    ProcessCtl(SELF, AllowIO, VGA_IOADDR);
    ProcessCtl(SELF, AllowIO, VGA_IODATA);
    
    /* Disable hardware cursor. */
    outb(VGA_IOADDR, 0x0a);
    outb(VGA_IODATA, 1 << 5);
    
    /* Successfull. */
    return ESUCCESS;
}
Пример #3
0
Error VGA::initialize()
{
    Memory::Range range;

    // Request VGA memory
    range.size   = PAGESIZE;
    range.access = Memory::User     |
                   Memory::Readable |
                   Memory::Writable;
    range.virt   = ZERO;
    range.phys   = VGA_PADDR;
    VMCtl(SELF, Map, &range);

    // Point to the VGA mapping
    vga = (u16 *) range.virt;

    // Clear screen
    for (uint i = 0; i < width * height; i++)
    {
        vga[i] = VGA_CHAR(' ', LIGHTGREY, BLACK);
    }

    // Disable hardware cursor
    WriteByte(VGA_IOADDR, 0x0a);
    WriteByte(VGA_IODATA, 1 << 5);

    // Successfull
    return ESUCCESS;
}
Пример #4
0
void putchar(Terminal *term, const teken_pos_t *pos,
             teken_char_t ch, const teken_attr_t *attr)
{
    /* Retrieve variables first. */
    u16 *buffer = term->getBuffer();
    Size width  = term->getWidth();

    /* Make sure to don't overwrite cursor. */
    term->hideCursor();

    /* Write the buffer. */
    buffer[pos->tp_col + (pos->tp_row * width)] =
        VGA_CHAR(ch, tekenToVGA[attr->ta_fgcolor], BLACK);
    
    /* Show cursor again. */
    term->showCursor();
}
Пример #5
0
void vga_putc(char c)
{
  uint16_t *addr;
  
  if (c == '\r') {
    curx = 0;
  } else if (VGA_PRINTABLE(c)) {
    addr = (uint16_t*)VGA_MEMSTART + cury * VGA_COLS + curx;
    *addr = VGA_CHAR(c);
    ++curx;
  }

  if (c == '\n' || curx == VGA_COLS)
    vga_newline();

  if (cury == VGA_ROWS) {
    vga_scroll();
    --cury;
  }
}
Пример #6
0
void fill(Terminal *term, const teken_rect_t *rect,
          teken_char_t ch, const teken_attr_t *attr)
{
    /* Make sure we don't overwrite the cursor. */
    term->hideCursor();
        
    /* Fill video memory; loop rows. */
    for (Size row = rect->tr_begin.tp_row;
                    row < rect->tr_end.tp_row; row++)
    {
        /* Loop columns. */
        for (Size col = rect->tr_begin.tp_col;
                        col < rect->tr_end.tp_col; col++)
        {
            term->getBuffer()[col + (row * term->getWidth())] =
                VGA_CHAR(ch, tekenToVGA[attr->ta_fgcolor], BLACK);
        }
    }
    /* Show cursor again. */
    term->showCursor();
}
Пример #7
0
int salir()
{
    int i;
    u16 *vga;
    MemoryMessage mem;

    /* Request VGA memory. */
    mem.action    = CreatePrivate;
    mem.bytes     = PAGESIZE;
    mem.virtualAddress  = ZERO;
    mem.physicalAddress = VGA_PADDR;
    mem.protection      = PAGE_RW | PAGE_PINNED;
    mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));

    /* Point to the VGA mapping. */
    vga = (u16 *) mem.virtualAddress;

    for (i=0; i < 2000; i++) {
      vga[i] = VGA_CHAR(' ', BLACK, BLACK);
    }
    return EXIT_SUCCESS;
}
Пример #8
0
void error2(char *linea1, char *linea2, char *linea3)
{
    char tecla;
    int i;
    int idosr=0;
    u16 *vga;
    MemoryMessage mem;

    /* Request VGA memory. */
    mem.action    = CreatePrivate;
    mem.bytes     = PAGESIZE;
    mem.virtualAddress  = ZERO;
    mem.physicalAddress = VGA_PADDR;
    mem.protection      = PAGE_RW | PAGE_PINNED;
    mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));

    /* Point to the VGA mapping. */
    vga = (u16 *) mem.virtualAddress;
    for (i=0; i < 820; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    for (i=820; i < 860; i++) {
      vga[i] = VGA_CHAR(' ', RED, RED);
    }
    for (i=860; i < 900; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    for (i=900; i < 940; i++) {
      vga[i] = VGA_CHAR(' ', BLACK, RED);
    }
    for (i=902; idosr < strlen(linea1); i++) {
      vga[i] = VGA_CHAR(linea1[idosr], BLACK, RED);
      idosr++;
    }
    for (i=940; i < 980; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    for (i=980; i < 1020; i++) {
      vga[i] = VGA_CHAR(' ', BLACK, RED);
    }
    idosr=0;
    for (i=982; idosr < strlen(linea2); i++) {
      vga[i] = VGA_CHAR(linea2[idosr], BLACK, RED);
      idosr++;
    }
    for (i=1020; i < 1060; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    for (i=1060; i < 1100; i++) {
      vga[i] = VGA_CHAR(' ', BLACK, RED);
    }
    idosr=0;
    for (i=1062; idosr < strlen(linea3); i++) {
      vga[i] = VGA_CHAR(linea3[idosr], BLACK, RED);
      idosr++;
    }
    for (i=1100; i < 2000; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    bar(" [A] Aceptar [B] Instrucciones");
    do {
      tecla = getchar();
    } while (tecla != 'A'&& tecla != 'a'&& tecla != 'B'&& tecla != 'b');
    if (tecla == 'B'|| tecla == 'b') {
      error("Direccion - Flechas del teclado", " ", " ");
    }
}
Пример #9
0
int hangman()
{
	/* numero de intentos (max 10)*/
	int intentos=0;
	char key='\b';
	char words[30][128] = {"ornitorrinco", "gato", "buho", "manzana", "aerogenerador", "arbol", "policia", "noviembre",
			     "carta", "entrada", "flor", "inteligencia", "chocolate", "literatura", "galleta", "movil",
			     "ordenador", "chimenea", "caramelo", "cucaracha", "mesa", "ardilla", "ventana", "llaves",
			     "ladrillo", "coche", "bombilla", "vino", "bicicleta", "atracciones"};
	char word[128];
	char fails[128];
	for (int w=0; w < 128; w++) {
		fails[w] = ' ';
	}
	int z=0;
	char str[] = {0x1b, 0x5b, 0x48, 0x1b, 0x5b, 0x4a, '\0'};
	int n = aleatorio();
	if (n > 29) {
		n = n / 2;
		if (n > 29) {
			n = n / 2;
		}
	}
	printf("%s", str);
	u16 *vga;
	MemoryMessage mem;

	/* Request VGA memory. */
	mem.action    = CreatePrivate;
	mem.bytes     = PAGESIZE;
	mem.virtualAddress  = ZERO;
	mem.physicalAddress = VGA_PADDR;
	mem.protection      = PAGE_RW | PAGE_PINNED;
	mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));

	/* Point to the VGA mapping. */
	vga = (u16 *) mem.virtualAddress;
	for (int i=0; i <= 127; i++) {
		word[i] = '_';
	}
	/* bucle principal del juego */
	while(1) {
		/* ponemos el color de fondo */
		for (int i=0; i <= 2000; i++) {
			vga[i] = VGA_CHAR(' ', BROWN, BROWN);
		}
		/*titulo de la ventana */
		window("AmayaOS Hangman", 2);
		/* cuadro de texto */
		for (int i=321; i >= 0; i++) {
			vga[i] = VGA_CHAR(' ', GREEN, GREEN);
			switch (i) {
				case 350:
					i = 400;
					break;
				case 430:
					i = 480;
					break;
				case 510:
					i = 560;
					break;
				case 590:
					i = -2;
					break;
			}
			for (int i=0; i < strlen(words[n]); i++) {
				vga[409+i] = VGA_CHAR(word[i], BLACK, GREEN);
			}
		}
		for (int i=361; i >= 0; i++) {
			vga[i] = VGA_CHAR(' ', GREEN, GREEN);
			if (i == 390 || i == 470 || i == 550 || i == 630 || i == 710 || i == 790 ||
			    i == 870 || i == 950 || i == 1030 || i == 1110 || i == 1190 || i == 1270 ||
			    i == 1350 || i == 1430 || i == 1510 || i == 1590 || i == 1670 || i == 1750 || i == 1830) {
				i = i+50;
			}
			if (i >= 1880) {
				i = -2;
			}
		}
		if (intentos >= 0) {
			vga[1572] = VGA_CHAR('-', BLACK, GREEN);
			vga[1573] = VGA_CHAR('-', BLACK, GREEN);
			vga[1574] = VGA_CHAR('-', BLACK, GREEN);
			vga[1575] = VGA_CHAR('-', BLACK, GREEN);
			vga[1576] = VGA_CHAR('-', BLACK, GREEN);
			if (intentos >= 1) {
				vga[1494] = VGA_CHAR('|', BLACK, GREEN);
				vga[1414] = VGA_CHAR('|', BLACK, GREEN);
				vga[1334] = VGA_CHAR('|', BLACK, GREEN);
				if (intentos >= 2) {
					vga[1254] = VGA_CHAR('|', BLACK, GREEN);
					vga[1174] = VGA_CHAR('|', BLACK, GREEN);
					vga[1094] = VGA_CHAR('|', BLACK, GREEN);
					if (intentos >= 3) {
						vga[1014] = VGA_CHAR('|', BLACK, GREEN);
						vga[934] = VGA_CHAR('|', BLACK, GREEN);
						vga[854] = VGA_CHAR('|', BLACK, GREEN);
						vga[855] = VGA_CHAR('/', BLACK, GREEN);
						vga[774] = VGA_CHAR('_', BLACK, GREEN);
						vga[775] = VGA_CHAR('_', BLACK, GREEN);
						vga[776] = VGA_CHAR('_', BLACK, GREEN);
						vga[777] = VGA_CHAR('_', BLACK, GREEN);
						if (intentos >= 4) {
							vga[857] = VGA_CHAR('|', BLACK, GREEN);
							if (intentos >= 5) {
								vga[937] = VGA_CHAR('O', BLACK, GREEN);
								if (intentos >= 6) {
									vga[1016] = VGA_CHAR('-', BLACK, GREEN);
									vga[1017] = VGA_CHAR('-', BLACK, GREEN);
									vga[1018] = VGA_CHAR('-', BLACK, GREEN);
									if (intentos >= 7) {
										vga[1097] = VGA_CHAR('|', BLACK, GREEN);
										if (intentos >= 8) {
											vga[1176] = VGA_CHAR('/', BLACK, GREEN);
											if (intentos >= 9) {
												vga[1178] = VGA_CHAR('\\', BLACK, GREEN);
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		for (int i=0; i < 10; i++) {
			vga[1642+i] = VGA_CHAR(fails[i], BLACK, GREEN);
		}
		bar("PULSA [RETURN] PARA SALIR");
		key = getchar();
		if (key == '\b') {
			for (int w=0; w < 128; w++) {
				fails[w] = ' ';
			}
			return 0;
		}
		else {
			for (int i=0; i < strlen(words[n]); i++) {
				if (key == words[n][i]) {
					word[i] = key;
				}
			}
			for (int i=0, tf=0; i < strlen(words[n]); i++) {
				if (key == words[n][i]) {
					tf++;
				}
				if (i == strlen(words[n])-1 && tf == 0 && key != fails[0] && key != fails[1] && key != fails[2] && key != fails[3] && key != fails[4] && key != fails[5] && key != fails[6] && key != fails[7] && key != fails[8] && key != fails[9]) {
					intentos++;
					fails[z] = key;
					z++;
				}
			}
		}
		if (intentos > 10) {
			error("", "             GAME OVER", "");
			intentos=0;
			n = aleatorio();
			if (n > 5) {
				n = n / 2;
			}
			for (int i=0; i <= 127; i++) {
				word[i] = '_';
				fails[i] = ' ';
				z = 0;
			}
		}
		for (int i=0; i < strlen(words[n]) && word[i] != '_'; i++) {
			if (i == strlen(words[n])-1) {
				error("             YOU", "             WIN", "");
				intentos=0;
				n = aleatorio();
				if (n > 5) {
					n = n / 2;
				}
				for (int i=0; i <= 127; i++) {
					word[i] = '_';
					fails[i] = ' ';
					z = 0;
				}
			}
		}
	}

}
Пример #10
0
int menu()
{
    char tecla;
    int i;
    u16 *vga;
    MemoryMessage mem;

    /* Request VGA memory. */
    mem.action    = CreatePrivate;
    mem.bytes     = PAGESIZE;
    mem.virtualAddress  = ZERO;
    mem.physicalAddress = VGA_PADDR;
    mem.protection      = PAGE_RW | PAGE_PINNED;
    mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));

    /* Point to the VGA mapping. */
    vga = (u16 *) mem.virtualAddress;

    for (i=0; i < 36; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    vga[36] = VGA_CHAR('A', BLACK, GREEN);
    vga[37] = VGA_CHAR('m', BLACK, GREEN);
    vga[38] = VGA_CHAR('a', BLACK, GREEN);
    vga[39] = VGA_CHAR('y', BLACK, GREEN);
    vga[40] = VGA_CHAR('a', BLACK, GREEN);
    vga[41] = VGA_CHAR('O', BLACK, GREEN);
    vga[42] = VGA_CHAR('S', BLACK, GREEN);
    for (i=43; i < 80; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    for (i=80; i < 1680; i++) {
      vga[i] = VGA_CHAR(' ', WHITE, WHITE);
    }
    vga[1520] = VGA_CHAR('A', BLUE, BROWN);
    vga[1521] = VGA_CHAR('m', BLUE, BROWN);
    vga[1522] = VGA_CHAR('a', BLUE, BROWN);
    vga[1523] = VGA_CHAR('C', BLUE, BROWN);
    vga[1524] = VGA_CHAR('A', BLUE, BROWN);
    vga[1525] = VGA_CHAR('L', BLUE, BROWN);
    vga[1526] = VGA_CHAR('C', BLUE, BROWN);
    vga[1527] = VGA_CHAR(' ', BLUE, BROWN);
    vga[1528] = VGA_CHAR('(', BLUE, BROWN);
    vga[1529] = VGA_CHAR('A', BLUE, BROWN);
    vga[1530] = VGA_CHAR(')', BLUE, BROWN);
    vga[1531] = VGA_CHAR(' ', BLUE, BROWN);
    vga[1600] = VGA_CHAR('H', BLUE, BROWN);
    vga[1601] = VGA_CHAR('a', BLUE, BROWN);
    vga[1602] = VGA_CHAR('n', BLUE, BROWN);
    vga[1603] = VGA_CHAR('g', BLUE, BROWN);
    vga[1604] = VGA_CHAR('m', BLUE, BROWN);
    vga[1605] = VGA_CHAR('a', BLUE, BROWN);
    vga[1606] = VGA_CHAR('n', BLUE, BROWN);
    vga[1607] = VGA_CHAR(' ', BLUE, BROWN);
    vga[1608] = VGA_CHAR('(', BLUE, BROWN);
    vga[1609] = VGA_CHAR('H', BLUE, BROWN);
    vga[1610] = VGA_CHAR(')', BLUE, BROWN);
    vga[1611] = VGA_CHAR(' ', BLUE, BROWN);
    vga[1680] = VGA_CHAR('W', BLUE, BROWN);
    vga[1681] = VGA_CHAR('a', BLUE, BROWN);
    vga[1682] = VGA_CHAR('m', BLUE, BROWN);
    vga[1683] = VGA_CHAR('a', BLUE, BROWN);
    vga[1684] = VGA_CHAR('/', BLUE, BROWN);
    vga[1685] = VGA_CHAR('W', BLUE, BROWN);
    vga[1686] = VGA_CHAR('A', BLUE, BROWN);
    vga[1687] = VGA_CHAR('+', BLUE, BROWN);
    vga[1688] = VGA_CHAR('(', BLUE, BROWN);
    vga[1689] = VGA_CHAR('W', BLUE, BROWN);
    vga[1690] = VGA_CHAR(')', BLUE, BROWN);
    vga[1691] = VGA_CHAR(' ', BLUE, BROWN);
    for (i=1692; i < 1760; i++) {
      vga[i] = VGA_CHAR(' ', WHITE, WHITE);
    }
    vga[1760] = VGA_CHAR('R', BLUE, BROWN);
    vga[1761] = VGA_CHAR('e', BLUE, BROWN);
    vga[1762] = VGA_CHAR('i', BLUE, BROWN);
    vga[1763] = VGA_CHAR('n', BLUE, BROWN);
    vga[1764] = VGA_CHAR('i', BLUE, BROWN);
    vga[1765] = VGA_CHAR('c', BLUE, BROWN);
    vga[1766] = VGA_CHAR('i', BLUE, BROWN);
    vga[1767] = VGA_CHAR('a', BLUE, BROWN);
    vga[1768] = VGA_CHAR('r', BLUE, BROWN);
    vga[1769] = VGA_CHAR('(', BLUE, BROWN);
    vga[1770] = VGA_CHAR('R', BLUE, BROWN);
    vga[1771] = VGA_CHAR(')', BLUE, BROWN);
    for (i=1772; i < 1840; i++) {
      vga[i] = VGA_CHAR(' ', WHITE, WHITE);
    }
    vga[1840] = VGA_CHAR('S', BLUE, BROWN);
    vga[1841] = VGA_CHAR('h', BLUE, BROWN);
    vga[1842] = VGA_CHAR('e', BLUE, BROWN);
    vga[1843] = VGA_CHAR('l', BLUE, BROWN);
    vga[1844] = VGA_CHAR('l', BLUE, BROWN);
    vga[1845] = VGA_CHAR('(', BLUE, BROWN);
    vga[1846] = VGA_CHAR('S', BLUE, BROWN);
    vga[1847] = VGA_CHAR(')', BLUE, BROWN);
    vga[1848] = VGA_CHAR(' ', BLUE, BROWN);
    vga[1849] = VGA_CHAR(' ', BLUE, BROWN);
    vga[1850] = VGA_CHAR(' ', BLUE, BROWN);
    vga[1851] = VGA_CHAR(' ', BLUE, BROWN);
    memoria();
    do {
      tecla = getchar();
    } while (tecla != 'R'&& tecla != 'r'&& tecla != 'S'&& tecla != 's'&& 'M'&& tecla != 'm'&& tecla != 'W'&& tecla != 'w'
             &&tecla != 'H'&& tecla != 'h' &&tecla != 'A'&& tecla != 'a');
    if (tecla == 'M'|| tecla == 'm') {
      return 0;
    }
    if (tecla == 'R'|| tecla == 'r') {
      return PrivExec(Reboot);
    }
    if (tecla == 'S'|| tecla == 's') {
      return -1;
    }
    if (tecla == 'W'|| tecla == 'w') {
      wama();
    }
/*
    if (tecla == 'P'|| tecla == 'p') {
      game();
    }
*/
    if (tecla == 'H'|| tecla == 'h') {
      hangman();
    }
    if (tecla == 'A'|| tecla == 'a') {
      ama_calc();
    }

    return 0;
}
Пример #11
0
int main(int argc, char **argv)
{
  while (1) {
    char tecla;
    int i;
    u16 *vga;
    MemoryMessage mem;

    /* Request VGA memory. */
    mem.action    = CreatePrivate;
    mem.bytes     = PAGESIZE;
    mem.virtualAddress  = ZERO;
    mem.physicalAddress = VGA_PADDR;
    mem.protection      = PAGE_RW | PAGE_PINNED;
    mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));

    /* Point to the VGA mapping. */
    vga = (u16 *) mem.virtualAddress;

    for (i=0; i < 36; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    vga[36] = VGA_CHAR('A', BLACK, GREEN);
    vga[37] = VGA_CHAR('m', BLACK, GREEN);
    vga[38] = VGA_CHAR('a', BLACK, GREEN);
    vga[39] = VGA_CHAR('y', BLACK, GREEN);
    vga[40] = VGA_CHAR('a', BLACK, GREEN);
    vga[41] = VGA_CHAR('O', BLACK, GREEN);
    vga[42] = VGA_CHAR('S', BLACK, GREEN);
    for (i=43; i < 80; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    for (i=80; i < 1920; i++) {
      vga[i] = VGA_CHAR(' ', WHITE, WHITE);
    }
    vga[1920] = VGA_CHAR(' ', BROWN, BROWN);
    vga[1921] = VGA_CHAR('M', BLUE, BROWN);
    vga[1922] = VGA_CHAR('e', BLUE, BROWN);
    vga[1923] = VGA_CHAR('n', BLUE, BROWN);
    vga[1924] = VGA_CHAR('u', BLUE, BROWN);
    vga[1925] = VGA_CHAR('(', BLUE, BROWN);
    vga[1926] = VGA_CHAR('M', BLUE, BROWN);
    vga[1927] = VGA_CHAR(')', BLUE, BROWN);
    for (i=1928; i <= 2000; i++) {
      vga[i] = VGA_CHAR(' ', BROWN, BROWN);
    }
    memoria();
    do {
      tecla = getchar();
    } while (tecla != 'M'&& tecla != 'm');
    if (tecla == 'M'|| tecla == 'm') {
      if (menu() == -1) {
    	char clean[] = {0x1b, 0x5b, 0x48, 0x1b, 0x5b, 0x4a, '\0'};
    	printf("%s", clean);
	return 0;
      }
    }
  }
}
Пример #12
0
void memoria()
{
    int i;
    u16 *vga;
    MemoryMessage mem;

    /* Request VGA memory. */
    mem.action    = CreatePrivate;
    mem.bytes     = PAGESIZE;
    mem.virtualAddress  = ZERO;
    mem.physicalAddress = VGA_PADDR;
    mem.protection      = PAGE_RW | PAGE_PINNED;
    mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));

    /* Point to the VGA mapping. */
    vga = (u16 *) mem.virtualAddress;

    /* Obtenemos el uso de la memoria. */
    mem.action = SystemMemory;
    mem.ipc(MEMSRV_PID, SendReceive, sizeof(mem));
    for (i=209; i <= 238; i++) {
      vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    vga[214] = VGA_CHAR('E', BLACK, GREEN);
    vga[215] = VGA_CHAR('s', BLACK, GREEN);
    vga[216] = VGA_CHAR('t', BLACK, GREEN);
    vga[217] = VGA_CHAR('a', BLACK, GREEN);
    vga[218] = VGA_CHAR('d', BLACK, GREEN);
    vga[219] = VGA_CHAR('o', BLACK, GREEN);
    vga[220] = VGA_CHAR(' ', BLACK, GREEN);
    vga[221] = VGA_CHAR('d', BLACK, GREEN);
    vga[222] = VGA_CHAR('e', BLACK, GREEN);
    vga[223] = VGA_CHAR(' ', BLACK, GREEN);
    vga[224] = VGA_CHAR('l', BLACK, GREEN);
    vga[225] = VGA_CHAR('a', BLACK, GREEN);
    vga[226] = VGA_CHAR(' ', BLACK, GREEN);
    vga[227] = VGA_CHAR('m', BLACK, GREEN);
    vga[228] = VGA_CHAR('e', BLACK, GREEN);
    vga[229] = VGA_CHAR('m', BLACK, GREEN);
    vga[230] = VGA_CHAR('o', BLACK, GREEN);
    vga[231] = VGA_CHAR('r', BLACK, GREEN);
    vga[232] = VGA_CHAR('i', BLACK, GREEN);
    vga[233] = VGA_CHAR('a', BLACK, GREEN);
    vga[289] = VGA_CHAR(' ', GREEN, GREEN);
    vga[369] = VGA_CHAR(' ', GREEN, GREEN);
    vga[449] = VGA_CHAR(' ', GREEN, GREEN);
    vga[290] = VGA_CHAR('T', BLACK, GREEN);
    vga[291] = VGA_CHAR('o', BLACK, GREEN);
    vga[292] = VGA_CHAR('t', BLACK, GREEN);
    vga[293] = VGA_CHAR('a', BLACK, GREEN);
    vga[294] = VGA_CHAR('l', BLACK, GREEN);
    vga[295] = VGA_CHAR(':', BLACK, GREEN);
    vga[296] = VGA_CHAR(' ', GREEN, GREEN);
    int a=mem.bytes / 1024;
    char a2[25];
    itoa(a2, 10, a);
    vga[297] = VGA_CHAR(a2[0], BLACK, GREEN);
    vga[298] = VGA_CHAR(a2[1], BLACK, GREEN);
    vga[299] = VGA_CHAR(a2[2], BLACK, GREEN);
    vga[300] = VGA_CHAR(a2[3], BLACK, GREEN);
    vga[301] = VGA_CHAR(a2[4], BLACK, GREEN);
    vga[302] = VGA_CHAR(a2[5], BLACK, GREEN);
    vga[303] = VGA_CHAR(a2[6], BLACK, GREEN);
    vga[304] = VGA_CHAR(a2[7], BLACK, GREEN);
    vga[305] = VGA_CHAR(a2[8], BLACK, GREEN);
    vga[306] = VGA_CHAR('K', BLACK, GREEN);
    vga[307] = VGA_CHAR('i', BLACK, GREEN);
    vga[308] = VGA_CHAR('B', BLACK, GREEN);
    for (i=309; i < 319; i++) {
	vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    vga[370] = VGA_CHAR('D', BLACK, GREEN);
    vga[371] = VGA_CHAR('i', BLACK, GREEN);
    vga[372] = VGA_CHAR('s', BLACK, GREEN);
    vga[373] = VGA_CHAR('p', BLACK, GREEN);
    vga[374] = VGA_CHAR('o', BLACK, GREEN);
    vga[375] = VGA_CHAR('n', BLACK, GREEN);
    vga[376] = VGA_CHAR('i', BLACK, GREEN);
    vga[377] = VGA_CHAR('b', BLACK, GREEN);
    vga[378] = VGA_CHAR('l', BLACK, GREEN);
    vga[379] = VGA_CHAR('e', BLACK, GREEN);
    vga[380] = VGA_CHAR(':', BLACK, GREEN);
    int b=mem.free / 1024;
    char b2[25];
    itoa(b2, 10, b);
    vga[381] = VGA_CHAR(b2[0], BLACK, GREEN);
    vga[382] = VGA_CHAR(b2[1], BLACK, GREEN);
    vga[383] = VGA_CHAR(b2[2], BLACK, GREEN);
    vga[384] = VGA_CHAR(b2[3], BLACK, GREEN);
    vga[385] = VGA_CHAR(b2[4], BLACK, GREEN);
    vga[386] = VGA_CHAR(b2[5], BLACK, GREEN);
    vga[387] = VGA_CHAR(b2[6], BLACK, GREEN);
    vga[388] = VGA_CHAR(b2[7], BLACK, GREEN);
    vga[389] = VGA_CHAR(b2[8], BLACK, GREEN);
    vga[390] = VGA_CHAR('K', BLACK, GREEN);
    vga[391] = VGA_CHAR('i', BLACK, GREEN);
    vga[392] = VGA_CHAR('B', BLACK, GREEN);
    for (i=393; i < 399; i++) {
	vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
    vga[450] = VGA_CHAR('E', BLACK, GREEN);
    vga[451] = VGA_CHAR('n', BLACK, GREEN);
    vga[452] = VGA_CHAR(' ', BLACK, GREEN);
    vga[453] = VGA_CHAR('U', BLACK, GREEN);
    vga[454] = VGA_CHAR('s', BLACK, GREEN);
    vga[455] = VGA_CHAR('o', BLACK, GREEN);
    vga[456] = VGA_CHAR(':', BLACK, GREEN);
    vga[457] = VGA_CHAR(' ', GREEN, GREEN);
    int c=(mem.bytes - mem.free) / 1024;
    char c2[25];
    itoa(c2, 10, c);
    vga[458] = VGA_CHAR(c2[0], BLACK, GREEN);
    vga[459] = VGA_CHAR(c2[1], BLACK, GREEN);
    vga[460] = VGA_CHAR(c2[2], BLACK, GREEN);
    vga[461] = VGA_CHAR(c2[3], BLACK, GREEN);
    vga[462] = VGA_CHAR(c2[4], BLACK, GREEN);
    vga[463] = VGA_CHAR(c2[5], BLACK, GREEN);
    vga[464] = VGA_CHAR(c2[6], BLACK, GREEN);
    vga[465] = VGA_CHAR(c2[7], BLACK, GREEN);
    vga[466] = VGA_CHAR(c2[8], BLACK, GREEN);
    vga[467] = VGA_CHAR('K', BLACK, GREEN);
    vga[468] = VGA_CHAR('i', BLACK, GREEN);
    vga[469] = VGA_CHAR('B', BLACK, GREEN);
    for (i=470; i < 479; i++) {
	vga[i] = VGA_CHAR(' ', GREEN, GREEN);
    }
}