VaneOSのメインGitリポジトリです。
リビジョン | 4e2db9b253c2ab695b0896f766d510aaf6c7be85 (tree) |
---|---|
日時 | 2014-10-25 23:58:01 |
作者 | vosystems <doradora.motochan@gmai...> |
コミッター | vosystems |
Add environment function
@@ -0,0 +1,21 @@ | ||
1 | +/* | |
2 | +*OS environment setting and function | |
3 | +*(C) 2014 VOSystems. | |
4 | +*/ | |
5 | +#include<Env.h> | |
6 | +#include<string.h> | |
7 | + | |
8 | +struct EnvVarCommon env; | |
9 | + | |
10 | +void set_env(void) | |
11 | +{ | |
12 | + strcpy(env.OS_NAME,"Vane Operating System"); | |
13 | + strcpy(env.PC_NAME,"Vane-Alpha"); | |
14 | + strcpy(env.USER_NAME,"Vane"); | |
15 | + strcpy(env.LANG,"en-us"); | |
16 | + strcpy(env.SHELL,"Vane Shell"); | |
17 | + env.major=0; | |
18 | + env.minor=4; | |
19 | + env.build=1000; | |
20 | + env.revision=env.build; | |
21 | +} |
@@ -43,9 +43,10 @@ TIMER_C=timer.c | ||
43 | 43 | TASK_C=task.c |
44 | 44 | TIME_C=time.c |
45 | 45 | SCAN_C=scan.c |
46 | +ENV_C=Env.c | |
46 | 47 | |
47 | 48 | #オブジェクト |
48 | -BOOT_OBJ=${BOOT_S:.S=.o} ${BOOT_C:.c=.o} ${VANE_S:.S=.o} ${KEYBOARD_C:.c=.o} ${STDIO_C:.c=.o} ${GDT_IDT_C:.c=.o} ${INTERRUPT_C:.c=.o} ${STRING_C:.c=.o} ${ASM_INTERRUPT_S:.S=.o} ${SCANCODE_C:.c=.o} ${MEMMAN_C:.c=.o} ${FAT_C:.c=.o} ${GRAPHIC_C:.c=.o} ${SYSTEM_C:.c=.o} ${MESSAGE_C:.c=.o} ${TIMER_C:.c=.o} ${TASK_C:.c=.o} ${TIME_C:.c=.o} ${SCAN_C:.c=.o} | |
49 | +BOOT_OBJ=${BOOT_S:.S=.o} ${BOOT_C:.c=.o} ${VANE_S:.S=.o} ${KEYBOARD_C:.c=.o} ${STDIO_C:.c=.o} ${GDT_IDT_C:.c=.o} ${INTERRUPT_C:.c=.o} ${STRING_C:.c=.o} ${ASM_INTERRUPT_S:.S=.o} ${SCANCODE_C:.c=.o} ${MEMMAN_C:.c=.o} ${FAT_C:.c=.o} ${GRAPHIC_C:.c=.o} ${SYSTEM_C:.c=.o} ${MESSAGE_C:.c=.o} ${TIMER_C:.c=.o} ${TASK_C:.c=.o} ${TIME_C:.c=.o} ${SCAN_C:.c=.o} ${ENV_C:.c=.o} | |
49 | 50 | |
50 | 51 | kernel: ${BOOT_OBJ} |
51 | 52 | ${LD} ${TARGET} ${BOOT_OBJ} |
@@ -2,9 +2,9 @@ | ||
2 | 2 | *System Functions |
3 | 3 | *(C) 2014 VOSystems. |
4 | 4 | */ |
5 | -#include <stdio.h> | |
5 | +#include<stdio.h> | |
6 | 6 | #include<VaneOS.h> |
7 | - | |
7 | +#include<Env.h> | |
8 | 8 | int vram_start_address; |
9 | 9 | char vmode; |
10 | 10 | short scrnX,scrnY; |
@@ -96,3 +96,10 @@ inline void shift_vga_text(void) | ||
96 | 96 | sc1=0xb8000; sc2=0xb8000+(80*2); |
97 | 97 | while(sc2<=0xc0000)*sc1++ = *sc2++; |
98 | 98 | } |
99 | + | |
100 | +inline void printVersion(void) | |
101 | +{ | |
102 | + printf("Vane Operating System [Version %d.%d(build %d)]\n",env.major, env.minor, env.build); | |
103 | + printf("Vane Shell [Version 0.2(build 100)]\n"); | |
104 | + printf("Copyright (C) 2013-2014 VaneOS Project. All rights reserved.\n"); | |
105 | +} |
@@ -25,6 +25,7 @@ | ||
25 | 25 | #include<Message.h> |
26 | 26 | #include<timer.h> |
27 | 27 | #include<System.h> |
28 | +#include<Env.h> | |
28 | 29 | |
29 | 30 | /*PROTOTYPE*/ |
30 | 31 | void outPortByte( unsigned short address, unsigned char value ); |
@@ -53,15 +54,16 @@ void cstart(unsigned long magic, unsigned long addr) | ||
53 | 54 | |
54 | 55 | mbi = (multiboot_info_t *) addr; |
55 | 56 | |
56 | - //ClearScreen(); | |
57 | 57 | vga_text_init(); |
58 | 58 | break_flag=0; system_key_code_flag=0; |
59 | 59 | screen=(unsigned short*)0xb8000;//VRam Setting |
60 | 60 | attr=WHITE; |
61 | 61 | |
62 | + set_env(); | |
63 | + | |
62 | 64 | /*Start Set Main Code*/ |
63 | - printf("VOSystems Vane Operating System [Version 0.5(build 1000)]\n"); | |
64 | - printf("VOSystems Console Host [Version 0.2(build 100)]\n"); | |
65 | + printVersion(); | |
66 | + putchar('\n'); | |
65 | 67 | |
66 | 68 | /*Setting IDT*/ |
67 | 69 | printTASK("Setting IDT....."); |
@@ -156,7 +158,7 @@ void cstart(unsigned long magic, unsigned long addr) | ||
156 | 158 | |
157 | 159 | }else if(strcmp("vane",cmd)==0){ |
158 | 160 | attr=CH_BLUE; |
159 | - printf("Vane Operating System\n"); | |
161 | + printVersion(); | |
160 | 162 | attr=WHITE; |
161 | 163 | |
162 | 164 | }else{ |
@@ -38,8 +38,7 @@ void strcpy(char* copy,const char* source) | ||
38 | 38 | { |
39 | 39 | while(*source!='\0') |
40 | 40 | { |
41 | - *copy=*source; | |
42 | - ++copy; ++source; | |
41 | + *copy++ =*source++; | |
43 | 42 | } |
44 | 43 | *copy='\0'; |
45 | 44 | return; |
@@ -0,0 +1,17 @@ | ||
1 | +/* | |
2 | +*OS environment setting and function | |
3 | +*(C) 2014 VOSystems. | |
4 | +*/ | |
5 | + | |
6 | +#ifndef _ENV_H_VANE_ | |
7 | +#define _ENV_H_VANE_ | |
8 | + | |
9 | +struct EnvVarCommon | |
10 | +{ | |
11 | + char* OS_NAME, PC_NAME, USER_NAME , LANG, SHELL; | |
12 | + unsigned int major, minor, build, revision; | |
13 | +}; | |
14 | + | |
15 | +extern struct EnvVarCommon env; | |
16 | + | |
17 | +#endif |
@@ -0,0 +1,17 @@ | ||
1 | +/* | |
2 | +*OS environment setting and function | |
3 | +*(C) 2014 VOSystems. | |
4 | +*/ | |
5 | + | |
6 | +#ifndef _ENV_H_VANE_ | |
7 | +#define _ENV_H_VANE_ | |
8 | + | |
9 | +struct EnvVarCommon | |
10 | +{ | |
11 | + char* PC_NAME, OS_NAME, USER_NAME , LANG, SHELL; | |
12 | + unsigned int major, minor, build, revision; | |
13 | +}; | |
14 | + | |
15 | +extern struct EnvVarCommon env; | |
16 | + | |
17 | +#endif |