int main(struct multiboot *mboot_ptr) { // All our initialisation calls will go in here. init_descriptor_tables(); monitor_clear(); initialise_paging(); // init_timer(3); int res = 0; monitor_clear(); monitor_write(str); monitor_write("\n\r"); monitor_write_hex(0xbadacacd); monitor_write_hex(0xbada0000); monitor_write("\n\r"); monitor_write_dec(0xadacacd); monitor_write("\n\r"); monitor_write_dec(1234567890); //memcpy(0xb8000+80*2*5,0xb8000,80*2*5); //memset(0xb8000,76,80*2*5); asm volatile ("int $0x3"); //u32int *ptr = (u32int*)0x0ffffff; //u32int do_page_fault = *ptr; return 0; }
int main(struct multiboot *mboot_ptr) { monitor_clear(); monitor_write("Hello, world"); return 0XDEADBABA; }
int main(struct multiboot *mboot_ptr) { // All our initialisation calls will go in here. monitor_clear(); monitor_write("Hello world!"); return 0xDEADBABA; }
// Bootstrap processor starts running C code here. // Allocate a real stack and switch to it, first // doing some setup required for memory allocator to work. int main(void) { monitor_clear (); // Print basic system information. cprintf ("Ensidia\n\n"); cprintf ("Copyright (c) 2013-2014 Fotis Koutoulakis\n"); cprintf ("Based on xv6 by Russ Cox et al, at MIT CSAIL\n"); kinit1(end, P2V(4*1024*1024)); // phys page allocator kvmalloc(); // kernel page table mpinit(); // collect info about this machine lapicinit(); seginit(); // set up segments cprintf("\ncpu%d: starting xng kernel\n\n", cpu->id); picinit(); // interrupt controller ioapicinit(); // another interrupt controller consoleinit(); // I/O devices & their interrupts uartinit(); // serial port pinit(); // process table tvinit(); // trap vectors binit(); // buffer cache fileinit(); // file table iinit(); // inode cache ideinit(); // disk if(!ismp) timerinit(); // uniprocessor timer startothers(); // start other processors kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() userinit(); // first user process // Finish setting up this processor in mpmain. mpmain(); }
int main(struct multiboot *mboot_ptr) { monitor_clear(); monitor_write("Initializing GDT...\n"); init_descriptor_tables(); monitor_write("GDT initialized.\n"); //asm volatile("int $0x3"); //asm volatile("int $0x4"); //asm volatile("sti"); //init_timer(50); initialise_paging(); monitor_write("Paging initialized.\n"); /*u32int *ptr = (u32int*)0xA0000000;*/ /*u32int do_page_fault = *ptr;*/ /*asm volatile ("int $0x3");*/ /*asm volatile ("int $0x4");*/ //monitor_write_dec(15); //monitor_write_dec(-48281); //monitor_write_dec(295180203); /*monitor_write_hex(0xFF);*/ /*monitor_put('\n');*/ /*monitor_write_hex(0x0);*/ /*monitor_put('\n');*/ /*monitor_write_hex(0xFAFABABA);*/ /*monitor_put('\n');*/ /*monitor_write_hex(0xABA);*/ // All our initialisation calls will go in here. return 0; }
/* // This is where everything starts... // If you dont understand this go learn osDeving */ int kernel_main ( struct multiboot *mboot_point, u32int initial_stack ) { monitor_clear(); initial_esp = initial_stack; mboot_ptr = mboot_point; init_serial ( 1, 9 );//DO NOT DISABLE monitor_set_cursor_pos ( 0, 0 ); monitor_set_fore_colour ( GREEN ); kprintf ( "MatrixOS " ); monitor_set_cursor_pos ( 11, 0 ); print_version(); kprintf ( "\n" ); monitor_set_fore_colour ( WHITE ); u32int *pt = alloc(0x1000, 1, kheap); //init(); //init_PCI(); //set_f_verbose ( VB_NONE ); //elf("binary.elf"); //setDisplay(0x118); //drawRect(0, 0, 1024, 768, 0x0077FF00); //drawRect(25, 45, 190, 390, 0x000000FF); //startShell(); //switch_to_user_mode(); for ( ;; ) {} }
void init_monitor() { monitor = &real_monitor; monitor->chars = (u16*) 0xB8000; terminal_state_set_colors(monitor, TS_WHITE, TS_BLACK); monitor_clear(); }
int main(struct multiboot *mboot_ptr) { // Initialise the screen (by clearing it) monitor_clear(); // Write out a sample string monitor_write("Hello, world!"); return 0; }
void initialize(u32int fg, u32int bg) { // Initialization calls update_settings(fg,bg); monitor_clear(); init_descriptor_tables(); asm("sti"); init_keyboard(); init_timer(1000); }
int main(multiboot_t *mboot_ptr) { monitor_clear(); init_gdt (); init_idt (); init_timer (20); init_pmm (mboot_ptr->mem_upper); init_vmm (); // Find all the usable areas of memory and inform the physical memory manager about them. uint32_t i = mboot_ptr->mmap_addr; while (i < mboot_ptr->mmap_addr + mboot_ptr->mmap_length) { mmap_entry_t *me = (mmap_entry_t*) i; // Does this entry specify usable RAM? if (me->type == 1) { uint32_t j; // For every page in this entry, add to the free page stack. for (j = me->base_addr_low; j < me->base_addr_low+me->length_low; j += 0x1000) { pmm_free_page (j); } } // The multiboot specification is strange in this respect - the size member does not include "size" itself in its calculations, // so we must add sizeof (uint32_t). i += me->size + sizeof (uint32_t); } printk ("Paging initialised.\n"); printk ("Mapping page...\n"); uint32_t addr = 0x900000; map (addr, 0x500000, PAGE_PRESENT|PAGE_WRITE); printk ("Accessing page...\n"); volatile uint32_t *_addr = (volatile uint32_t*)addr; *_addr = 0x567; printk ("*addr: %x\n", *_addr); printk ("Unmapping page...\n"); unmap (addr); printk ("Trying to access again (should page fault)...\n"); *_addr = 0x678; printk ("*addr: %x\n", *_addr); asm volatile ("sti"); for (;;); return 0xdeadbeef; }
void main(struct multiboot *mboot_ptr) { #include "common.h" #include "monitor.h" const char src[50] = "Hello World! Big brother is watching!"; char dest[50]; memcpy(dest, src, strlen(src)); memset(dest, 'F', strlen(dest)); monitor_clear(); monitor_write(dest); }
int nx_main(struct multiboot *mboot) { init_gdt(); init_idt(); monitor_clear(); monitor_write_str("Hello world!\n"); init_timer(20); asm volatile ("sti"); return 0; }
void kmain(uint32_t magic, multiboot_info_t *mboot, uintptr_t ebp) { monitor_clear(); printf("Booting Dionysus!\n"); ASSERT(magic == MULTIBOOT_BOOTLOADER_MAGIC && "Not booted with multiboot."); ASSERT(mboot->flags & MULTIBOOT_INFO_MEMORY && "No memory info."); ASSERT(mboot->flags & MULTIBOOT_INFO_MEM_MAP && "No memory map."); printf("Initializing GDT\n"); init_gdt(); printf("Initializing IDT\n"); init_idt(); // Check for modules if (mboot->flags & MULTIBOOT_INFO_MODS && mboot->mods_count) { multiboot_module_t *mods = (multiboot_module_t *)mboot->mods_addr; placement_address = mods[mboot->mods_count - 1].mod_end + KERNEL_BASE; } printf("Setting up paging\n"); init_paging(mboot->mem_lower + mboot->mem_upper, mboot->mmap_addr, mboot->mmap_length); printf("Initializing timers\n"); init_time(); init_timer(); printf("Starting task scheduling\n"); init_tasking(ebp); init_syscalls(); printf("Initializing vfs\n"); init_vfs(); printf("Initializing driver subsystem\n"); init_blockdev(); init_chardev(); init_term(); printf("Enumerating PCI bus(ses)\n"); init_pci(); dump_pci(); init_devfs(); ASSERT(mount(NULL, "/dev", "devfs", 0) == 0); init_ide(); halt(); }
int kmain(multiboot_t *mboot_ptr) { monitor_clear(); printk("8888888888 d8b 888 .d88888b. .d8888b.\n"); printk("888 Y8P 888 d88P\" \"Y88b d88P Y88b\n"); printk("888 888 888 888 Y88b.\n"); printk("8888888 88888b.d88b. 888 888 888 888 \"Y888b.\n"); printk("888 888 \"888 \"88b 888 888 888 888 \"Y88b.\n"); printk("888 888 888 888 888 888 888 888 \"888\n"); printk("888 888 888 888 888 888 Y88b. .d88P Y88b d88P\n"); printk("8888888888 888 888 888 888 888 \"Y88888P\" \"Y8888P\"\n"); init_gdt (); init_idt (); init_keyboard(); setup_x87_fpu (); init_timer (20); init_pmm (mboot_ptr->mem_upper); init_vmm (); init_heap (); // Find all the usable areas of memory and inform the physical memory manager about them. uint32_t i = mboot_ptr->mmap_addr; while (i < mboot_ptr->mmap_addr + mboot_ptr->mmap_length) { mmap_entry_t *me = (mmap_entry_t*) i; // Does this entry specify usable RAM? if (me->type == 1) { uint32_t j; // For every page in this entry, add to the free page stack. for (j = me->base_addr_low; j < me->base_addr_low+me->length_low; j += 0x1000) { pmm_free_page (j); } } // The multiboot specification is strange in this respect - the size member does not include "size" itself in its calculations, // so we must add sizeof (uint32_t). i += me->size + sizeof (uint32_t); } kernel_elf = elf_from_multiboot (mboot_ptr); asm volatile ("sti"); panic ("Testing panic mechanism"); for (;;); return 0xdeadbeef; }
int main(struct multiboot *mboot_ptr) { // Initialise the screen (by clearing it) init_descriptor_tables(); monitor_clear(); // Write out a sample string // for(int i=0;i<26;i++) monitor_write("Hello, world!\n"); asm volatile ("int $0x3"); // asm volatile ("int $0x4"); return 0; }
int start_main() { char c; /*welcom page*/ FILE *art; art = fopen("lisaos.txt","r" ); monitor_clear(); c = fgetc(art); while ( c != EOF ) { putch(c = ( fgetc(art)) ); } fclose( art ); delay(200); monitor_clear(); //end of welcom page shell(); }
int main(struct multiboot *mboot_ptr) { initialize(WHITE,BLACK); print("What's your name? "); char *name = malloc(80); gets(name); print3("Hello, ",name,"!\n"); gets(name); monitor_clear(); print("I'm COMPUTER!"); while (1) {} return 0; }
int main(multiboot_t *mboot_ptr) { monitor_clear(); init_gdt (); init_idt (); init_timer (20); init_pmm (mboot_ptr->mem_upper); init_vmm (); init_heap (); // Find all the usable areas of memory and inform the physical memory manager about them. uint32_t i = mboot_ptr->mmap_addr; while (i < mboot_ptr->mmap_addr + mboot_ptr->mmap_length) { mmap_entry_t *me = (mmap_entry_t*) i; // Does this entry specify usable RAM? if (me->type == 1) { uint32_t j; // For every page in this entry, add to the free page stack. for (j = me->base_addr_low; j < me->base_addr_low+me->length_low; j += 0x1000) { pmm_free_page (j); } } // The multiboot specification is strange in this respect - the size member does not include "size" itself in its calculations, // so we must add sizeof (uint32_t). i += me->size + sizeof (uint32_t); } kernel_elf = elf_from_multiboot (mboot_ptr); asm volatile ("sti"); void *a = kmalloc (8); void *b = kmalloc (8); void *c = kmalloc (8); kfree (a); kfree (b); void *d = kmalloc (24); printk ("a: %x, b: %x, c: %x, d: %x\n", a, b, c, d); panic ("Testing panic mechanism"); for (;;); return 0xdeadbeef; }
int main(struct multiboot *mboot_ptr) { // Initialise all the ISRs and segmentation init_descriptor_tables(); // Initialise the screen (by clearing it) monitor_clear(); // Find the location of our initial ramdisk. ASSERT(mboot_ptr->mods_count > 0); u32int initrd_location = *((u32int*)mboot_ptr->mods_addr); u32int initrd_end = *(u32int*)(mboot_ptr->mods_addr+4); // Don't trample our module with placement accesses, please! placement_address = initrd_end; // Start paging. initialise_paging(); // Initialise the initial ramdisk, and set it as the filesystem root. fs_root = initialise_initrd(initrd_location); // list the contents of / int i = 0; struct dirent *node = 0; while ( (node = readdir_fs(fs_root, i)) != 0) { monitor_write("Found file "); monitor_write(node->name); fs_node_t *fsnode = finddir_fs(fs_root, node->name); if ((fsnode->flags&0x7) == FS_DIRECTORY) { monitor_write("\n\t(directory)\n"); } else { monitor_write("\n\t contents: \""); char buf[256]; u32int sz = read_fs(fsnode, 0, 256, buf); int j; for (j = 0; j < sz; j++) monitor_put(buf[j]); monitor_write("\"\n"); } i++; } return 0; }
int main(struct multiboot *mboot_ptr) { // All our initialisation calls will go in here. // Initialise all the ISRs and segmentation init_descriptor_tables(); // Clear monitor and write a test monitor_clear(); monitor_write("Hello, world!"); asm volatile ("int $0x3"); asm volatile ("int $0x4"); return 0xDEADBABA; }
int kmain(void* mbd, unsigned int magic) { // Initialise the screen (by clearing it) monitor_clear(); // Alloc some memory u8int mem; memset(&mem, 32, 5); monitor_write("Hello, world!\n"); monitor_write_bin(mem); monitor_write("\n"); monitor_write_dec(mem); return 0; }
int main(struct multiboot *mboot_ptr) { // Initialise all the ISRs and segmentation init_descriptor_tables(); // Initialise the screen (by clearing it) monitor_clear(); /*initialise_paging(); monitor_write("Hello, paging world!\n"); u32int *ptr = (u32int*)0xA0000000; u32int do_page_fault = *ptr; */ monitor_write("Arjun"); return 0; }
void main(){ // unsigned char msg[] = "Boa noite from stack"; init_idt(); monitor_clear(); monitor_write("Hello, world!"); // screen_print_str("testando letra verde"); // screen_print_str(msg); asm volatile ("int $0x0"); // while(1); nao precisa mais. // usei instrucao hlt no boot }
int kernel_main(struct multiboot *mboot_ptr) { // Initialise all the ISRs and segmentation init_descriptor_tables(); // Initialise the screen (by clearing it) monitor_clear(); // Write out a sample string monitor_write("Hello, world!\n"); asm volatile("int $0x3"); asm volatile("int $0x4"); asm volatile("sti"); init_timer(50); return 0; }
void interpret() { char * pointer = buffers[current_terminal]; if (!strcmp(pointer, "clear")) { monitor_clear(); monitor_put('>'); } else if (!strcmp(pointer, "about")) { monitor_write("ArquiOS v0.1 by Elli Federico and Pierri Alan\n>"); } else if (!strcmp(pointer, "help")) { monitor_write("about - Display info about this OS\n"); monitor_write("help - Display this help menu\n"); monitor_write("kblayout - Display current keyboard layout\n"); monitor_write("kben - Switch keyboard layout to English\n"); monitor_write("kbsp - Switch keyboard layout to Spanish\n"); monitor_write( "chat - Switch to chat mode - Type exit to exit chatmode\n"); monitor_write("exit - Exit OS\n"); monitor_put('>'); } else if (!strcmp(pointer, "kblayout")) { if (kbLayout) { monitor_write("Keyboard currently in English\n>"); } else { monitor_write("Keyboard currently in Spanish\n>"); } } else if (!strcmp(pointer, "kben")) { kbLayout = EN; monitor_write("Keyboard switched to English\n>"); } else if (!strcmp(pointer, "kbsp")) { kbLayout = SP; monitor_write("Keyboard switched to Spanish\n>"); } else if (!strcmp(pointer, "exit")) { run = 0; } else if (!strcmp(pointer, "chat")) { current_program = CHAT; bash_to_chat(); } else { monitor_write("Invalid command - type 'help' for a command list\n>"); } }
void kernel_main() { monitor_clear(); /* monitor_write("Hello ASKernel\n"); monitor_write("Hello World!\n"); monitor_write_hex(0x01234567); monitor_write("\n"); monitor_write_hex(0x89abcdef); monitor_write("\n"); monitor_write_dec(0xffffffff); monitor_write("\n"); monitor_write_dec(189064); monitor_write("\n"); */ init_descriptor_tables(); __asm__ __volatile__("int $0x03"); __asm__ __volatile__("int $0x04"); __asm__ __volatile__("int $0x14"); /* init_timer(50); __asm__ __volatile__("sti"); */ init_paging(); monitor_write("Hello Paging World!\n"); uint32_t* ptr = (uint32_t*)0xa0000000; uint32_t do_page_fault = *ptr; }
int main(struct multiboot *mboot_ptr) { // All our initialisation calls will go in here. //init descriptor tables init_descriptor_tables(); //Testing screen instructions monitor_clear(); monitor_write("Hello World"); u32int n = 0xDEADBABA; monitor_write("\n"); monitor_write_hex(n); monitor_write("\n"); n = 1234567890; monitor_write_dec(n); asm volatile ("int $0x1"); //asm volatile ("int $0x4"); return 0xDEADBABA; }
void monitor_clear_with_bg(u16 bg) { terminal_state_set_bg(monitor, bg); monitor_clear(); }
int main(struct multiboot *mboot_ptr, u32int initial_stack) { initial_esp = initial_stack; // Initialise all the ISRs and segmentation init_descriptor_tables(); // Initialise the screen (by clearing it) monitor_clear(); // Initialise the PIT to 100Hz asm volatile("sti"); init_timer(50); // Find the location of our initial ramdisk. ASSERT(mboot_ptr->mods_count > 0); u32int initrd_location = *((u32int*)mboot_ptr->mods_addr); u32int initrd_end = *(u32int*)(mboot_ptr->mods_addr+4); // Don't trample our module with placement accesses, please! placement_address = initrd_end; // Start paging. initialise_paging(); // Start multitasking. initialise_tasking(); // Initialise the initial ramdisk, and set it as the filesystem root. fs_root = initialise_initrd(initrd_location); // Create a new process in a new address space which is a clone of this. int ret = fork(); monitor_write("fork() returned "); monitor_write_hex(ret); monitor_write(", and getpid() returned "); monitor_write_hex(getpid()); monitor_write("\n============================================================================\n"); // The next section of code is not reentrant so make sure we aren't interrupted during. asm volatile("cli"); // list the contents of / int i = 0; struct dirent *node = 0; while ( (node = readdir_fs(fs_root, i)) != 0) { monitor_write("Found file "); monitor_write(node->name); fs_node_t *fsnode = finddir_fs(fs_root, node->name); if ((fsnode->flags&0x7) == FS_DIRECTORY) { monitor_write("\n\t(directory)\n"); } else { monitor_write("\n\t contents: \""); char buf[256]; u32int sz = read_fs(fsnode, 0, 256, buf); int j; for (j = 0; j < sz; j++) monitor_put(buf[j]); monitor_write("\"\n"); } i++; } monitor_write("\n"); asm volatile("sti"); return 0; }
// Bootstrap processor starts running C code here. // Allocate a real stack and switch to it, first // doing some setup required for memory allocator to work. int main(void) { monitor_clear(); xylos_logo(); kinit1(end, P2V(4 * 1024 * 1024)); // phys page allocator, 16MB for kernel kvmalloc(); // kernel page table mpinit(); // collect info about this machine lapicinit(); seginit(); // set up segments cprintf("Initializing interrupts... "); init_generic_irq_table(); picinit(); // interrupt controller ioapicinit(); // another interrupt controller cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); cprintf("Initializing console and serial... "); consoleinit(); // I/O devices & their interrupts uartinit(); // serial port cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); cprintf("Setting up swap space disk... "); swapinit(); cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); cprintf("Initializing tasking... "); pinit(); // process table tvinit(); // trap vectors binit(); // buffer cache cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); cprintf("Initializing pipe IPC... "); init_pipe_ipc_system(); if(pipe_ipc_sanitycheck() == 0) { cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); } cprintf("Initializing direct IPC... "); init_direct_ipc_table(); if(direct_ipc_sanitycheck() == 0) { cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); } cprintf("Mounting root filesystem... "); fileinit(); // file table ideinit(); // disk cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); if(!ismp) { cprintf("Starting up uniprocessor CPU... "); timerinit(); // uniprocessor timer cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); } if(ismp) { if(ncpu > 1) { cprintf("Starting up %d CPU cores... ", ncpu); } else { cprintf("Starting up %d CPU core... ", ncpu); } } startothers(); // start other processors kinit2(P2V(4 * 1024 * 1024), P2V(PHYSTOP)); // 16MB to PHYSTOP [234MB] if(ismp) { cprintf_color(COLOR_BLACK, COLOR_LIGHT_GREEN, false, "done\n"); } // detects and starts km drivers auto_enable_nic(); // first user process userinit(); // Finish setting up this processor in mpmain. mpmain(); }