From 2b194b83286424408694bd9b230b816736fd6c5f Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Wed, 27 Aug 2014 11:41:40 +0200 Subject: added simple binary font data --- Makefile | 13 ++++++++++++- README.md | 5 ++++- binfont.src | 29 +++++++++++++++++++++++++++++ font_monofool1.bmp | Bin 180138 -> 0 bytes font_monofool1.xcf | Bin 13724 -> 0 bytes kernel/kernel.c | 9 ++++++++- makefont.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 binfont.src delete mode 100644 font_monofool1.bmp delete mode 100644 font_monofool1.xcf create mode 100644 makefont.py diff --git a/Makefile b/Makefile index 6f193e9..659d86d 100644 --- a/Makefile +++ b/Makefile @@ -9,14 +9,25 @@ #lets use the size of a 1.44 floppy for a start for our boot img IMAGE_SIZE=1474560 +#data starts at 0x8000 +DATA_START=32768 #final image all: FoolOS.img #assembling of final image -FoolOS.img: mbr.bin kernel.bin fill.bin +FoolOS.img: Fool.img FoolData.img fill.bin cat $^ | head -c $(IMAGE_SIZE) > $@ +Fool.img: mbr.bin kernel.bin fill.bin + cat $^ | head -c $(DATA_START) > $@ + +FoolData.img: binfont.bin + cat $^ > $@ + +binfont.bin: binfont.src + python makefont.py + #some data just to fill up to the target image_size fill.bin: boot/fill.asm nasm -f bin $^ -o $@ diff --git a/README.md b/README.md index 99e5d97..6c508ba 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This is a simple and useless "operating system", with very basic features, sorry. It is the fruit of my fundamental explorations of the x86 architectures, 32-bit protected mode, interrupt handling, memory management, the floppy disk controller, networking as well as -a couple of other things. +VESA and a couple of other things. ![Screenshot of FoolOS](/screenshots/foolos.png?raw=true "FoolOs Kernel") @@ -34,6 +34,7 @@ All features are only very rudiemntary and buggy. * PCI bus scanning * Physical memory manager * Floppy disk driver +* VESA TODOS ----- @@ -46,6 +47,8 @@ Some things I would like to add someday: * virtual memory managment / paging * user space / ELF binaries support * multitasking +* mouse +* simple window manager Issues ------ diff --git a/binfont.src b/binfont.src new file mode 100644 index 0000000..cd0a076 --- /dev/null +++ b/binfont.src @@ -0,0 +1,29 @@ +// All letters are made from ones and zeros and eight * ten bits +// do not use zeros and ones in this file!! apart of the patterns of +// course +// A + +11111111 +11111111 +11000011 +11000011 +11111111 +11111111 +11000011 +11000011 +11000011 +11000011 + +// B + +11111000 +11111110 +11000111 +11000011 +11111110 +11111110 +11000011 +11000111 +11111110 +11111000 + diff --git a/font_monofool1.bmp b/font_monofool1.bmp deleted file mode 100644 index c5e4eb9..0000000 Binary files a/font_monofool1.bmp and /dev/null differ diff --git a/font_monofool1.xcf b/font_monofool1.xcf deleted file mode 100644 index 3a1627d..0000000 Binary files a/font_monofool1.xcf and /dev/null differ diff --git a/kernel/kernel.c b/kernel/kernel.c index f1ba6b7..5af172e 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -92,6 +92,7 @@ void kernel_main() // kernel main loop uint8_t t=0; + uint8_t o=0; // while(1) // { @@ -107,9 +108,15 @@ void kernel_main() for(j=0;j<768;j++) { - PutPixel(i,j,t); + if(o<2)PutPixel(i,j,0xff); + else if(o<4)PutPixel(i,j,0x5f0); + else PutPixel(i,j,0xf0000); + } t+=125; + o++; + if(o>8)o=0; + } diff --git a/makefont.py b/makefont.py new file mode 100644 index 0000000..22ee576 --- /dev/null +++ b/makefont.py @@ -0,0 +1,42 @@ +# this is a simple script to convert the binfont.src into binary +# everything but 0 an 1 are ignored + +import binascii + +f=open("binfont.src",'r') +o=open("binfont.bin",'wb') + +b="" +l=0 +while True: + + c=f.read(1) + + if not c: + break + + if c=="0": + l+=1 + b+=c + + if c=="1": + l+=1 + b+=c + + if l==8: + print b + l=0 + o.write(chr(int(b,2))) + b="" + + + + + +print "eof" + + + +o.close() + + -- cgit v1.2.3