OSDN Git Service

Makefileのマイナーチェンジ
authorvosystems <doradora.motochan@gmail.com>
Thu, 23 Oct 2014 13:36:35 +0000 (22:36 +0900)
committervosystems <doradora.motochan@gmail.com>
Thu, 23 Oct 2014 13:36:35 +0000 (22:36 +0900)
Kernel/Makefile
Kernel/Makefile~
Kernel/test.c~
bu/boot.c [deleted file]
bu/load.S [deleted file]
bu/multiboot.h [deleted file]

index a82c67e..2c372c3 100644 (file)
@@ -13,9 +13,9 @@ LIBVANE               = ../lib/libvanec.a ../lib/libvanego.a
 FLAGS          = -m32 -ffreestanding -fno-common -fno-builtin -fomit-frame-pointer -O2 -c
 FLAGSC         = -m32 -ffreestanding -fno-common -nostdlib -masm=intel -fno-builtin -fomit-frame-pointer -O2 -c
 LD          = ld -Ttext 0x100000 -T linkerscript -melf_i386 --oformat elf32-i386 -o
-FLAGSDEBUG = -ffreestanding -fno-common -nostdlib -masm=intel -fno-builtin -fomit-frame-pointer -O2
+FLAGSDEBUG = -ffreestanding -fno-common -nostdlib -masm=intel -fno-builtin -fomit-frame-pointer -O2 -c
 file =boot.c
-DEBUG_OBJ=debug.o
+DEBUG_OBJ=../tmp/debug.o
 
 #サフィックス
 .S.o:
@@ -50,6 +50,7 @@ kernel: ${BOOT_OBJ}
        ${LD} ${TARGET} ${BOOT_OBJ}
 
 debug: 
+       @ ${RM} -f ${DEBUG_OBJ}
        ${CC} ${INCLUDES} ${FLAGSDEBUG} ${file}
        
 ${BOOT_OBJ}: ${BOOT_SRC}
index 96e415f..03ac92f 100644 (file)
@@ -13,9 +13,9 @@ LIBVANE               = ../lib/libvanec.a ../lib/libvanego.a
 FLAGS          = -m32 -ffreestanding -fno-common -fno-builtin -fomit-frame-pointer -O2 -c
 FLAGSC         = -m32 -ffreestanding -fno-common -nostdlib -masm=intel -fno-builtin -fomit-frame-pointer -O2 -c
 LD          = ld -Ttext 0x100000 -T linkerscript -melf_i386 --oformat elf32-i386 -o
-FLAGSDEBUG = -g -ffreestanding -fno-common -nostdlib -masm=intel -fno-builtin -fomit-frame-pointer -O1 -c
+FLAGSDEBUG = -ffreestanding -fno-common -nostdlib -masm=intel -fno-builtin -fomit-frame-pointer -O2 -c
 file =boot.c
-DEBUG_OBJ=debug.o
+DEBUG_OBJ=../tmp/debug.o
 
 #サフィックス
 .S.o:
@@ -51,6 +51,7 @@ kernel: ${BOOT_OBJ}
 
 debug: 
        ${CC} ${INCLUDES} ${FLAGSDEBUG} ${file}
+       ${RM} -f ${DEBUG_OBJ}
        
 ${BOOT_OBJ}: ${BOOT_SRC}
 clean::
index e69de29..fe322c3 100644 (file)
@@ -0,0 +1,5 @@
+int main(void)
+{
+       printf("")
+       return 0;
+}
diff --git a/bu/boot.c b/bu/boot.c
deleted file mode 100644 (file)
index 1f4e672..0000000
--- a/bu/boot.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/*!
-       \file boot.c
-       \Desc Kernel and Setting.
-       (C) 2014 VOSystems.
-*/
-
-#include<multiboot.h>
-#include<VaneOS.h>
-#include<KeyBoard.h>
-#include<Interrupt.h>
-#include<GDT_IDT.h>
-#include<stdio.h>
-#include<scancode.h>
-#include<memory.h>
-
-/*PROTOTYPE*/
-void outPortByte( unsigned short address, unsigned char value );
-unsigned char inPortByte( unsigned short address );
-void initPIC( void );
-int setPitCounter( int freq, unsigned char counter, unsigned char mode );
-void initPit( void );
-void clear_state(void);
-
-/*!
-       load.S call this function
-       
-       Set All & Call shell
-       (C)2014 VOSystems.
-       \create 2014/09/23
-       \update 2014/09/27
-       \author 2m
-*/
-void cstart(unsigned long magic, mbi_t* info)
-{
-       /*Common Settings*/
-       char cmd[100]={0};
-       struct MEMMAN *memman=(struct MEMMAN*)MEMMAN_ADDR;
-       
-       ClearScreen();
-       scan_code=0; break_flag=0;      system_key_code_flag=0;
-       screen=(unsigned short*)0xb8000;//VRam Setting
-       attr=WHITE;
-       
-       /*Start Set Main Code*/
-       printf("VOSystems Vane Operating System  [Version 0.2(build 300)]\n");
-       
-       /*Setting IDT*/
-       setupInterruptGate(DEF_IDT_INT_NUM_IRQ1,KeyBoard_Interrupt_asm);//Register Keyboard interrupt handler
-       setupInterruptGate(DEF_IDT_INT_NUM_IRQ0,Timer_Interrupt_asm);//Register Timer interrupt handler
-       idtr.size       = NUM_IDT * sizeof( GATE_DESCRIPTOR );
-       idtr.base       = ( GATE_DESCRIPTOR *)idt;
-       
-       load_idt();
-       printOK("Setting IDT.....");
-       
-       /*Setting GDT*/
-       /*set up null descriptor*/
-       gdt[NULL_DESCRIPTOR].limitLo    = DEF_GDT_NULL_LIMIT;
-       gdt[NULL_DESCRIPTOR].baseLo             = DEF_GDT_NULL_BASELO;
-       gdt[NULL_DESCRIPTOR].baseMid    = DEF_GDT_NULL_BASEMID;
-       gdt[NULL_DESCRIPTOR].flags              = DEF_GDT_NULL_FLAGS;
-       gdt[NULL_DESCRIPTOR].baseHi             = DEF_GDT_NULL_BASEHI;
-       /* set up code descriptor */
-       gdt[CODE_DESCRIPTOR].limitLo    = DEF_GDT_CODE_LIMIT;
-       gdt[CODE_DESCRIPTOR].baseLo             = DEF_GDT_CODE_BASELO;
-       gdt[CODE_DESCRIPTOR].baseMid    = DEF_GDT_CODE_BASEMID;
-       gdt[CODE_DESCRIPTOR].flags              = DEF_GDT_CODE_FLAGS;
-       gdt[CODE_DESCRIPTOR].baseHi             = DEF_GDT_CODE_BASEHI;
-
-       /* set up data descriptor */
-       gdt[DATA_DESCRIPTOR].limitLo    = DEF_GDT_DATA_LIMIT;
-       gdt[DATA_DESCRIPTOR].baseLo             = DEF_GDT_DATA_BASELO;
-       gdt[DATA_DESCRIPTOR].baseMid    = DEF_GDT_DATA_BASEMID;
-       gdt[DATA_DESCRIPTOR].flags              = DEF_GDT_DATA_FLAGS;
-       gdt[DATA_DESCRIPTOR].baseHi             = DEF_GDT_DATA_BASEHI;
-       
-       gdtr.size       = NUM_GDT * sizeof( SEGMENT_DESCRIPTOR );
-       gdtr.base       = ( SEGMENT_DESCRIPTOR *)gdt;
-       
-       load_gdt();
-       printOK("Setting GDT.....");
-               
-       initPIC();
-       printOK("Init PIC.....");
-       
-       initKeyboard();
-       keyboardEnableKBD();
-       printOK("Init Keyboard.....");
-       
-       setPitCounter(100,DEF_PIT_COM_COUNTER0,DEF_PIT_COM_MODE_SQUAREWAVE);
-       initPit();
-       printOK("Init PIT.....");
-       
-       memman_init(memman);
-       memman_free(memman,0x00001000,0x0009e000);
-       memman_free(memman,0x00400000,((info->mem_lower+info->mem_upper)*1024)-0x00400000);
-       printOK("Starting Memory Manager.....");
-       
-       unsigned int info->
-       int* fat=(int*)memman_alloc_4k(memman,4*2880);
-       file_readfat(fat,(unsigned char*)(ADR_DISKIMG+0x000200));
-       printOK("Loading FAT File System.....");
-       
-       if(magic!=MULTIBOOT_BOOTLOADER_MAGIC){
-               printFAIL("Loading Memory Info.....");
-               
-       }else{
-               printOK("Loading Memory Info.....");
-               
-       }
-       printf("\nLowMemory = %d KiB , UpperMemory = %d KiB , TotalMemory = %d MiB\n\n",info->mem_lower,
-               info->mem_upper,(info->mem_lower+info->mem_upper+1024)/1024);
-       printf("Free Memory = %d MiB\n",memman_total(memman)/(1024*1024));
-       
-       puts("KernelShell/Root/>");
-       scanf("%s",&cmd);
-       printf("%s",cmd);
-       while(1);
-       return;
-}
-
-void outPortByte( unsigned short address, unsigned char value )
-{
-       __asm__ __volatile__( "out %%dx, %%al" : : "d"(address), "a"(value) );
-}
-
-unsigned char inPortByte( unsigned short address )
-{
-       unsigned char data;
-
-       __asm__ __volatile__( "mov %%dx, %%ax" : : "a"(address) );
-       __asm__ __volatile__( "in %al, %dx" );
-       __asm__ __volatile__( "mov %%bl, %%al" : "=b"(data) );
-       return( data );
-}
-
-void initPIC( void )
-{
-       disable();
-       
-       outPortByte( PORT_MASTER_PIC_COMMAND,   PIC_ICW1        );
-       outPortByte( PORT_SLAVE_PIC_COMMAND,    PIC_ICW1        );
-
-       outPortByte( PORT_MASTER_PIC_DATA,      PIC_MASTER_ICW2 );
-       outPortByte( PORT_SLAVE_PIC_DATA,       PIC_SLAVE_ICW2  );
-
-       outPortByte( PORT_MASTER_PIC_DATA,      PIC_MASTER_ICW3 );
-       outPortByte( PORT_SLAVE_PIC_DATA,       PIC_SLAVE_ICW3  );
-
-       outPortByte( PORT_MASTER_PIC_DATA,      PIC_MASTER_ICW4 );
-       outPortByte( PORT_SLAVE_PIC_DATA,       PIC_SLAVE_ICW4  );
-       
-       outPortByte( PORT_MASTER_PIC_IMR, (~PIC_IMR_MASK_IRQ0) & (~PIC_IMR_MASK_IRQ2 )  );
-       outPortByte( PORT_SLAVE_PIC_IMR, PIC_IMR_MASK_IRQ_ALL                           );
-       
-    outPortByte( PORT_MASTER_PIC_IMR, ( ~PIC_IMR_MASK_IRQ0 )
-                 & ( ~PIC_IMR_MASK_IRQ1 ) & ( ~PIC_IMR_MASK_IRQ2 ) );
-    outPortByte( PORT_SLAVE_PIC_IMR, PIC_IMR_MASK_IRQ_ALL          );
-    
-    enable();
-}
-
-int setPitCounter( int freq, unsigned char counter, unsigned char mode )
-{
-       unsigned short  count;
-       unsigned char   command;
-
-       /* --------------------------------------------------------------------- */
-       /*      calculate frequency                                              */
-       /* --------------------------------------------------------------------- */
-       count = ( unsigned short )( DEF_PIT_CLOCK / freq );
-
-       /* --------------------------------------------------------------------- */
-       /*      make initial command                                             */
-       /* --------------------------------------------------------------------- */
-       command = mode | DEF_PIT_COM_RL_DATA | counter;
-
-       outPortByte( PIT_REG_CONTROL, command );
-
-       /* --------------------------------------------------------------------- */
-       /*      send counter value                                               */
-       /* --------------------------------------------------------------------- */
-       outPortByte( PIT_REG_COUNTER0, ( unsigned char )( count & 0xFF          ) );
-       outPortByte( PIT_REG_COUNTER0, ( unsigned char )( ( count >> 8 ) & 0xFF ) );
-}
-
-/*
-       Funtion     :initPit
-       Input       :void
-       Output      :void
-       Return      :void 
-
-       Description :initialize pic
-*/
-void initPit( void )
-{
-       /* --------------------------------------------------------------------- */
-       /*      set counter0 100Hz                                               */
-       /* --------------------------------------------------------------------- */
-       setPitCounter( 100, DEF_PIT_COM_COUNTER0,  DEF_PIT_COM_MODE_SQUAREWAVE );
-}
diff --git a/bu/load.S b/bu/load.S
deleted file mode 100644 (file)
index 0e5f845..0000000
--- a/bu/load.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#define ASM_FILE 1
-#include <multiboot.h>
-#define EXT_C(func)                    func
-#define STACK_SIZE                     0x4000
-#define MULTIBOOT_HEADER_FLAGS         0x00000003
-
-.text
-.global start,_start
-
-start:
- _start:
-        jmp     multiboot_entry
-        .align  4
-
-multiboot_header:
-        .long   MULTIBOOT_HEADER_MAGIC
-        .long   MULTIBOOT_HEADER_FLAGS
-        .long   -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
-
-multiboot_entry:
-        movl    $(stack + STACK_SIZE), %esp
-        pushl   $0
-        popf
-        pushl   %ebx
-        pushl   %eax
-        
-        call    EXT_C(cstart)
-
-loop:
-        hlt
-        jmp    loop
-
-        
-.comm   stack, STACK_SIZE
diff --git a/bu/multiboot.h b/bu/multiboot.h
deleted file mode 100644 (file)
index 7dd52a0..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef MULTIBOOT_HEADER
-#define MULTIBOOT_HEADER 1
-     
-#define MULTIBOOT_SEARCH                        8192     
-#define MULTIBOOT_HEADER_MAGIC                  0x1BADB002     
-#define MULTIBOOT_BOOTLOADER_MAGIC              0x2BADB002     
-#define MULTIBOOT_UNSUPPORTED                   0x0000fffc     
-#define MULTIBOOT_MOD_ALIGN                     0x00001000     
-#define MULTIBOOT_INFO_ALIGN                    0x00000004     
-#define MULTIBOOT_PAGE_ALIGN                    0x00000001     
-#define MULTIBOOT_MEMORY_INFO                   0x00000002     
-#define MULTIBOOT_VIDEO_MODE                    0x00000004     
-#define MULTIBOOT_AOUT_KLUDGE                   0x00010000
-#define MULTIBOOT_INFO_MEMORY                   0x00000001
-#define MULTIBOOT_INFO_BOOTDEV                  0x00000002
-#define MULTIBOOT_INFO_CMDLINE                  0x00000004
-#define MULTIBOOT_INFO_MODS                     0x00000008
-#define MULTIBOOT_INFO_AOUT_SYMS                0x00000010
-#define MULTIBOOT_INFO_ELF_SHDR                 0X00000020  
-#define MULTIBOOT_INFO_MEM_MAP                  0x00000040
-#define MULTIBOOT_INFO_DRIVE_INFO               0x00000080
-#define MULTIBOOT_INFO_CONFIG_TABLE             0x00000100 
-#define MULTIBOOT_INFO_BOOT_LOADER_NAME         0x00000200
-#define MULTIBOOT_INFO_APM_TABLE                0x00000400
-#define MULTIBOOT_INFO_VIDEO_INFO               0x00000800
-  
-#ifndef ASM_FILE
-     
-#define MULTIBOOT_HEADER_MAGIC          0x1BADB002
-#define MULTIBOOT_HEADER_FLAGS          0x00000000
-#define MULTIBOOT_HEADER_CHECKSUM       -(MULTIBOOT_HEADER_MAGIC+MULTIBOOT_HEADER_FLAGS)
-#define KERNEL_STACK_SIZE               0x100000
-
-#define MULTIBOOT_BOOTLOADER_MAGIC      0x2BADB002
-
-
-typedef struct mbi_info {
-  unsigned long flags;
-  unsigned long mem_lower;
-  unsigned long mem_upper;
-  unsigned long boot_device;
-  unsigned long cmdline;
-  unsigned long mods_count;
-  unsigned long mods_addr;
-
-  // The section header table for ELF
-  unsigned long num;
-  unsigned long size;
-  unsigned long addr;
-  unsigned long shndx;
-
-  unsigned long mmap_length;
-  unsigned long mmap_addr;
-} __attribute__((__packed__)) mbi_t;
-
-// The memory map
-typedef struct memory_map {
-  unsigned long size;
-  unsigned long base_addr_low;
-  unsigned long base_addr_high;
-  unsigned long length_low;
-  unsigned long length_high;
-  unsigned long type;
-} __attribute__((__packed__)) memory_map;
-     
-#endif /* ! ASM_FILE */
-     
-#endif /* ! MULTIBOOT_HEADER */
-