zoukankan      html  css  js  c++  java
  • 30天自制操作系统-day9

    30天自制操作系统-day9

    这次我们更改main.c以及相关文件,生成任务栏,只需修改main.c如下
    main.c

    #include<header.h>
    void bootmain(void){
    	//注意这里的函数名字为bootmain,因为在entry.S中设定的入口名字也是bootmain,两者要保持一致
    	int i, xsize, ysize;
    	char *vram;
    	init_palette();
    
    	clear_screen(15);	//由于一进来这里显示的是"my kernel is running"等字符串,这里刷屏为灰色,去除字符串
    
    	vram=(char*)0xa0000;
    	xsize=320;
    	ysize=200;
    
    	boxfill8(vram, xsize, COL8_008484, 0, 0, xsize-1, ysize-29);
    	boxfill8(vram, xsize, COL8_C6C6C6, 0, ysize-28, xsize-1, ysize-28);
    	boxfill8(vram, xsize, COL8_FFFFFF, 0, ysize-27, xsize-1, ysize-27);
    	boxfill8(vram, xsize, COL8_C6C6C6, 0, ysize-26, xsize-1, ysize-1);
    
    	boxfill8(vram, xsize, COL8_FFFFFF, 3, ysize-24, 59, ysize-24);
    	boxfill8(vram, xsize, COL8_FFFFFF, 2, ysize-24, 2, ysize-4);
    	boxfill8(vram, xsize, COL8_848484, 3, ysize-4, 59, ysize-4);
    	boxfill8(vram, xsize, COL8_848484, 59, ysize-23, 59, ysize-5);
    	boxfill8(vram, xsize, COL8_000000, 2, ysize-3, 59, ysize-3);
    	boxfill8(vram, xsize, COL8_000000, 60, ysize-24, 60, ysize-3);
    
    	boxfill8(vram, xsize, COL8_848484, xsize-47, ysize-24, xsize-4, ysize-24);
    	boxfill8(vram, xsize, COL8_848484, xsize-47, ysize-23, xsize-47, ysize-4);
    	boxfill8(vram, xsize, COL8_FFFFFF, xsize-47, ysize-3, xsize-4, ysize-3);
    	boxfill8(vram, xsize, COL8_FFFFFF, xsize-3, ysize-24, xsize-3, ysize-3);
    
    	for(;;){
    		io_halt();
    	}
    }
    

    header.h

    .................
    .................
    #define COL8_000000 0
    #define COL8_FF0000 1 
    #define COL8_00FF00 2
    #define COL8_FFFF00 3
    #define COL8_0000FF 4
    #define COL8_FF00FF 5
    #define COL8_00FFFF 6
    #define COL8_FFFFFF 7
    #define COL8_C6C6C6 8
    #define COL8_840000 9
    #define COL8_008400 10
    #define COL8_848400 11
    #define COL8_000084 12
    #define COL8_840084 13
    #define COL8_008484 14
    #define COL8_848484 15
    
    效果如下:

    源码链接:https://github.com/zchrissirhcz/osask-linux.git

  • 相关阅读:
    Vue.js_础学习之DOM操作
    node REPL
    node npm
    Vue.js_getter and setter
    tomcat+nginx+redis实现均衡负载以及session共享
    深入浅出微服务框架dubbo(一):基础篇
    Linux下安装zip解压功能
    Linux下查看CPU型号,内存大小,硬盘空间的命令
    Linux查看系统信息命令
    MyBatis自动生成代码之generatorConfig配置文件及其详细解读
  • 原文地址:https://www.cnblogs.com/wangdongfang/p/14365029.html
Copyright © 2011-2022 走看看