• 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

  • 相关阅读:
    MYSQL mysql.user表中权限对应的解释
    MYSQL LOCK IN SHARE MODE&FOR UPDATE
    什么是索引
    ol,li,ul,dl,dt,dd
    CSS类与选择器【转】http://www.cnblogs.com/duanhuajian/archive/2012/12/17/2821524.html
    bootstrap笔记
    iPhone应用程序开发基础之一: IBOutlet与IBAction
    Objective-C中的加号与减号
    Linux下*.tar.gz文件解压缩命令
    【PHP+MySQL学习笔记】php操作MySQL数据库中语句
  • 原文地址:https://www.cnblogs.com/wangdongfang/p/14365029.html
Copyright © 2020-2023  润新知