RE: Total Spam - Nerymon - 01.05.2013
ok, klingt nach nem fairen Deal :3
RE: Total Spam - Mähikel - 01.05.2013
[Video: http://www.youtube.com/watch?v=-EKWWRd-Wvk]
RE: Total Spam - Nerymon - 01.05.2013
bah... ich dös heut dauernd ein... hab letzte Nacht eindeutig zu wenig geschlafen D:
RE: Total Spam - darklink - 01.05.2013
Hmm, kompiliert krig ichs...
Code: /**
* MTGos - LowLevel OS
* Copyright (C) 2013 Morten Delenk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Please Read "LICENSE" for the Complete License
**/
#include "Video.hpp" // Video Klasse
#include "multiboot.hpp" // Multiboot header
unsigned long long gdt[7]; // Die GDT long long array
unsigned long long idt[256]; // Das IDT long long array
extern "C" void set_entry(int i, unsigned int base, unsigned int limit, int flags); // GDT Entry
extern "C" void new_int(int i,unsigned int offset, unsigned int Selector, unsigned int flags); // IDT Entry
extern "C" void kernelMain(const Multiboot& multiboot_structur, unsigned int multiboot_magic); // Main
extern "C" void divide_zero(); // Interrupt 0
extern "C" void FATAL(); // Interrupt 2
struct {
unsigned short limit; // Pointer
void * pointer;
} PACKED gdtp; //GDT
void kernelMain(const Multiboot& multiboot_structur, unsigned int multiboot_magic)
{
screen << "[INFO] Set Up GDT\n"; // Info
set_entry(0,0,0,0); //Nullsegment
set_entry(1,0,0xFFFF,0x9A); //Kernel-Codesegment
set_entry(2,0,0xFFFF,0x92); //Kernel-Datensegment
set_entry(3,0,0xFFFF,0xFA); //User-Codesegment
set_entry(4,0,0xFFFF,0xF2); //User-Datensegment
set_entry(5,0,0xFFFF,0xE9); //TSS
set_entry(6,0,0xFFFF,0xE9); //TSS
gdtp.limit=7*8-1; // länge
gdtp.pointer=gdt; // gdt pointer
asm volatile("lgdt %0" : : "m" (gdtp)); // Eingabe
screen << "[INFO] GDT setted\n"; // Info
FATAL(); // Fehler
int zeiger=divide_zero; // Interrupt 0
new_int(0,zeiger,1,0xF7); // Setze
zeiger=FATAL; // Interrupt 2
new_int(2,zeiger,1,0x97); //setze
for(;;); // cli; hlt
}
void set_entry(int i, unsigned int base, unsigned int limit, int flags)
{
gdt[i]=limit&0xFFFFLL;
gdt[i]|=(base&0xFFFFFFLL)<<16;
gdt[i]|=(flags&0xFFLL)<<40;
gdt[i]|=((limit>>16) & 0xFLL) << 48;
gdt[i]|=((flags>>8)&0xFFLL)<<52;
gdt[i]|=((base>>24)&0xFFLL)<<56;
}
void new_int(int i, unsigned int offset, unsigned int Selector, unsigned int flags)
{
idt[i]=offset&0xFFFFLL;
idt[i]|=(Selector&0xFFFFLL)<<16;
idt[i]|=(flags&0xFFLL)<<40;
idt[i]|=((offset>>16)&0xFFFF)<<48;
}
void divide_zero()
{
screen << "[WARNING] Divide by Zero!\n";
asm("int $0x04;iret");
}
void FATAL()
{
screen << background(color::blue) << color::white << " " << background(color::white) << color::blue << "FATAL ERROR" << background(color::blue) << color::white << "\nMTGos has stopped running because it encountered a Problem:\n";
screen << "UNKNOWN FATAL ERROR\n";
asm(".p:\n\tcli;hlt;jmp .p");
}
RE: Total Spam - phistoh - 01.05.2013
Puh.
RE: Total Spam - darklink - 01.05.2013
Mr. Mortens Sources ohne Kommis :P
(01.05.2013, 17:37)Morten schrieb: Hmm, kompiliert krig ichs...
Code: /**
* MTGos - LowLevel OS
* Copyright (C) 2013 Morten Delenk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Please Read "LICENSE" for the Complete License
**/
#include "Video.hpp" // Video Klasse
#include "multiboot.hpp" // Multiboot header
unsigned long long gdt[7]; // Die GDT long long array
unsigned long long idt[256]; // Das IDT long long array
extern "C" void set_entry(int i, unsigned int base, unsigned int limit, int flags); // GDT Entry
extern "C" void new_int(int i,unsigned int offset, unsigned int Selector, unsigned int flags); // IDT Entry
extern "C" void kernelMain(const Multiboot& multiboot_structur, unsigned int multiboot_magic); // Main
extern "C" void divide_zero(); // Interrupt 0
extern "C" void FATAL(); // Interrupt 2
struct {
unsigned short limit; // Pointer
void * pointer;
} PACKED gdtp; //GDT
void kernelMain(const Multiboot& multiboot_structur, unsigned int multiboot_magic)
{
screen << "[INFO] Set Up GDT\n"; // Info
set_entry(0,0,0,0); //Nullsegment
set_entry(1,0,0xFFFF,0x9A); //Kernel-Codesegment
set_entry(2,0,0xFFFF,0x92); //Kernel-Datensegment
set_entry(3,0,0xFFFF,0xFA); //User-Codesegment
set_entry(4,0,0xFFFF,0xF2); //User-Datensegment
set_entry(5,0,0xFFFF,0xE9); //TSS
set_entry(6,0,0xFFFF,0xE9); //TSS
gdtp.limit=7*8-1; // länge
gdtp.pointer=gdt; // gdt pointer
asm volatile("lgdt %0" : : "m" (gdtp)); // Eingabe
screen << "[INFO] GDT setted\n"; // Info
FATAL(); // Fehler
int zeiger=divide_zero; // Interrupt 0
new_int(0,zeiger,1,0xF7); // Setze
zeiger=FATAL; // Interrupt 2
new_int(2,zeiger,1,0x97); //setze
for(;;); // cli; hlt
}
void set_entry(int i, unsigned int base, unsigned int limit, int flags)
{
gdt[i]=limit&0xFFFFLL;
gdt[i]|=(base&0xFFFFFFLL)<<16;
gdt[i]|=(flags&0xFFLL)<<40;
gdt[i]|=((limit>>16) & 0xFLL) << 48;
gdt[i]|=((flags>>8)&0xFFLL)<<52;
gdt[i]|=((base>>24)&0xFFLL)<<56;
}
void new_int(int i, unsigned int offset, unsigned int Selector, unsigned int flags)
{
idt[i]=offset&0xFFFFLL;
idt[i]|=(Selector&0xFFFFLL)<<16;
idt[i]|=(flags&0xFFLL)<<40;
idt[i]|=((offset>>16)&0xFFFF)<<48;
}
void divide_zero()
{
screen << "[WARNING] Divide by Zero!\n";
asm("int $0x04;iret");
}
void FATAL()
{
screen << background(color::blue) << color::white << " " << background(color::white) << color::blue << "FATAL ERROR" << background(color::blue) << color::white << "\nMTGos has stopped running because it encountered a Problem:\n";
screen << "UNKNOWN FATAL ERROR\n";
asm(".p:\n\tcli;hlt;jmp .p");
}
Jetzt mit Kommi s :P
19:00
RE: Total Spam - Nerymon - 01.05.2013
blah
RE: Total Spam - Doflamingo - 01.05.2013
Ich bin satt und happy und müde. :3
RE: Total Spam - phistoh - 02.05.2013
Morgen.
RE: Total Spam - phistoh - 02.05.2013
Vorerst zu Hause!
Was ein Wetter draußen!
|