2023-11-25 19:48:01 -08:00
|
|
|
#include <mammoth/ipc/port_server.h>
|
2023-11-22 14:39:27 -08:00
|
|
|
#include <mammoth/util/debug.h>
|
|
|
|
#include <mammoth/util/init.h>
|
2023-11-21 19:14:02 -08:00
|
|
|
#include <victoriafalls/victoriafalls.yunq.client.h>
|
2023-11-15 16:41:51 -08:00
|
|
|
#include <yellowstone/yellowstone.yunq.client.h>
|
2023-11-09 12:55:44 -08:00
|
|
|
|
2023-11-21 19:32:31 -08:00
|
|
|
#include "framebuffer/console.h"
|
2023-11-15 19:20:52 -08:00
|
|
|
#include "framebuffer/framebuffer.h"
|
2023-11-21 19:14:02 -08:00
|
|
|
#include "framebuffer/psf.h"
|
2023-11-26 13:39:39 -08:00
|
|
|
#include "terminal.h"
|
2023-11-15 19:20:52 -08:00
|
|
|
|
2023-11-09 12:55:44 -08:00
|
|
|
uint64_t main(uint64_t init_port) {
|
|
|
|
ParseInitPort(init_port);
|
|
|
|
|
|
|
|
dbgln("Teton Starting");
|
2023-11-15 16:41:51 -08:00
|
|
|
|
2023-11-09 12:55:44 -08:00
|
|
|
// 1. Set up framebuffer.
|
2023-11-15 16:41:51 -08:00
|
|
|
YellowstoneClient client(gInitEndpointCap);
|
|
|
|
|
|
|
|
FramebufferInfo framebuffer;
|
|
|
|
RET_ERR(client.GetFramebufferInfo({}, framebuffer));
|
2023-11-15 19:20:52 -08:00
|
|
|
dbgln("FB addr {x}, bpp {}, width {} , height {}, pitch {}",
|
|
|
|
framebuffer.address_phys(), framebuffer.bpp(), framebuffer.width(),
|
|
|
|
framebuffer.height(), framebuffer.pitch());
|
|
|
|
|
|
|
|
Framebuffer fbuf(framebuffer);
|
|
|
|
|
2023-11-09 12:55:44 -08:00
|
|
|
// 2. Parse a font file.
|
|
|
|
|
2023-11-22 16:42:42 -08:00
|
|
|
Psf psf("/default8x16.psfu");
|
2023-11-21 19:14:02 -08:00
|
|
|
psf.DumpHeader();
|
|
|
|
|
2023-11-25 19:48:01 -08:00
|
|
|
// 3. Write a line to the screen.
|
2023-11-21 19:32:31 -08:00
|
|
|
Console console(fbuf, psf);
|
2023-11-26 11:29:15 -08:00
|
|
|
console.WriteChar('>');
|
2023-11-21 19:14:02 -08:00
|
|
|
|
2023-11-26 13:39:39 -08:00
|
|
|
Terminal terminal(console);
|
|
|
|
terminal.Register();
|
2023-11-26 11:21:56 -08:00
|
|
|
|
2023-11-26 13:39:39 -08:00
|
|
|
Thread lthread = terminal.Listen();
|
2023-11-26 11:21:56 -08:00
|
|
|
|
|
|
|
check(lthread.Join());
|
2023-11-09 12:55:44 -08:00
|
|
|
|
2023-11-26 11:21:56 -08:00
|
|
|
return glcr::OK;
|
2023-11-09 12:55:44 -08:00
|
|
|
}
|