1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Removed hello program.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-28 11:34:50 +01:00
parent 6781308360
commit 1686b2b903
4 changed files with 1 additions and 72 deletions

View file

@ -11,7 +11,7 @@ endif
REMOTE=192.168.2.6 REMOTE=192.168.2.6
REMOTEUSER=sortie REMOTEUSER=sortie
REMOTECOPYDIR:=/home/$(REMOTEUSER)/Desktop/MaxsiOS REMOTECOPYDIR:=/home/$(REMOTEUSER)/Desktop/MaxsiOS
MODULES=libmaxsi hello games mkinitrd utils sortix MODULES=libmaxsi games mkinitrd utils sortix
VERSION=0.5dev VERSION=0.5dev
DEBNAME:=sortix_$(VERSION)_$(CPU) DEBNAME:=sortix_$(VERSION)_$(CPU)

7
hello/.gitignore vendored
View file

@ -1,7 +0,0 @@
*.o
*.tmp
*.bin
*.iso
*.so
*.a
hello

View file

@ -1,26 +0,0 @@
# Set up variables such that we can easily cross-compile.
OSROOT=..
include ../crosscompilemakefile.mak
INITRDDIR:=../initrd
LOCALBINARIES:=\
hello \
BINARIES:=$(addprefix $(INITRDDIR)/,$(LOCALBINARIES))
all: install
install: $(LOCALBINARIES)
cp $(LOCALBINARIES) $(INITRDDIR)
rm -f $(LOCALBINARIES)
%: %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -O2 -c $< -o $@.o
$(LD) $(LDFLAGS) $@.o -o $@ $(LIBS)
sh: mxsh
cp $< $@
clean:
rm -f $(BINARIES) $(LOCALBINARIES) *.o

View file

@ -1,38 +0,0 @@
#include <stdio.h>
#include <libmaxsi/sortix-keyboard.h>
int main(int argc, char* argv[])
{
printf("\e[m\e[0J");
printf("Hello World: Welcome to Sortix! This is a program running in user-space.\n"
"This program is a probably the worst text editor ever made.\n"
"You are currently using the buggy USA keyboard layout.\n"
"This terminal is controlled using ANSI Escape Sequences:\n"
" - Type \e[32mESC 2 J\e[m to clear the screen\n"
);
bool lastwasesc = false;
while (true)
{
unsigned method = System::Keyboard::POLL;
uint32_t codepoint = System::Keyboard::ReceiveKeystroke(method);
if ( codepoint == 0 ) { continue; }
if ( codepoint & Maxsi::Keyboard::DEPRESSED ) { continue; }
if ( codepoint == Maxsi::Keyboard::UP ) { printf("\e[A"); continue; }
if ( codepoint == Maxsi::Keyboard::DOWN ) { printf("\e[B"); continue; }
if ( codepoint == Maxsi::Keyboard::RIGHT ) { printf("\e[C"); continue; }
if ( codepoint == Maxsi::Keyboard::LEFT ) { printf("\e[D"); continue; }
if ( codepoint == Maxsi::Keyboard::ESC ) { printf("\e["); lastwasesc = true; continue; }
if ( lastwasesc && codepoint == '[' ) { continue; }
if ( codepoint >= 0x80 ) { continue; }
char msg[2]; msg[0] = codepoint; msg[1] = '\0';
printf(msg);
lastwasesc = false;
}
return 0;
}