<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OS DEV C++]]></title><description><![CDATA[<p>Ich benütze den DevCpp Compiler und er kann dass nicht compilieren</p>
<pre><code class="language-cpp">#include &quot;system.h&quot;

void *memcpy(void *dest, const void *src, size_t count)
{
    const char *sp = (const char *)src;
    char *dp = (char *)dest;
    for(; count != 0; count--) *dp++ = *sp++;
    return dest;
}

int *memset(void *dest, char val, size_t count)
{
    char *temp = (char *)dest;
    for( ; count != 0; count--) *temp++ = val;
    return dest;
}

unsigned short *memsetw(unsigned short *dest, unsigned short val, size_t count)
{
    unsigned short *temp = (unsigned short *)dest;
    for( ; count != 0; count--) *temp++ = val;
    return dest;
}

size_t strlen(const char *str)
{
    size_t retval;
    for(retval = 0; *str != '\0'; str++) retval++;
    return retval;
}

unsigned char inportb (unsigned short _port)
{
    unsigned char rv;
    __asm__ __volatile__ (&quot;inb %1, %0&quot; : &quot;=a&quot; (rv) : &quot;dN&quot; (_port));
    return rv;
}

void outportb (unsigned short _port, unsigned char _data)
{
    __asm__ __volatile__ (&quot;outb %1, %0&quot; : : &quot;dN&quot; (_port), &quot;a&quot; (_data));
}

int main()
{
    int i;

    gdt_install();
    idt_install();
    isrs_install();
    irq_install();
    init_video();
    timer_install();
    keyboard_install();

    __asm__ __volatile__ (&quot;sti&quot;);

    puts(&quot;Willkommen im MF OS 1.0\n&quot;);

//    i = 10 / 0;
//    putch(i);

    for (;;);
}
</code></pre>
<p>und das ist die headerdatei</p>
<pre><code class="language-cpp">#ifndef __SYSTEM_H
#define __SYSTEM_H

typedef int size_t;

/* This defines what the stack looks like after an ISR was running */
struct regs
{
    unsigned int gs, fs, es, ds;
    unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax;
    unsigned int int_no, err_code;
    unsigned int eip, cs, eflags, useresp, ss;    
};

/* MAIN.C */
extern void *memcpy(void *dest, const void *src, size_t count);
extern void *memset(void *dest, char val, size_t count);
extern unsigned short *memsetw(unsigned short *dest, unsigned short val, size_t count);
extern size_t strlen(const char *str);
extern unsigned char inportb (unsigned short _port);
extern void outportb (unsigned short _port, unsigned char _data);

/* CONSOLE.C */
extern void init_video(void);
extern void puts(unsigned char *text);
extern void putch(unsigned char c);
extern void cls();

/* GDT.C */
extern void gdt_set_gate(int num, unsigned long base, unsigned long limit, unsigned char access, unsigned char gran);
extern void gdt_install();

/* IDT.C */
extern void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags);
extern void idt_install();

/* ISRS.C */
extern void isrs_install();

/* IRQ.C */
extern void irq_install_handler(int irq, void (*handler)(struct regs *r));
extern void irq_uninstall_handler(int irq);
extern void irq_install();

/* TIMER.C */
extern void timer_wait(int ticks);
extern void timer_install();

/* KEYBOARD.C */
extern void keyboard_install();

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/156954/os-dev-c</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 00:39:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/156954.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Aug 2006 19:03:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to OS DEV C++ on Mon, 21 Aug 2006 19:03:44 GMT]]></title><description><![CDATA[<p>Ich benütze den DevCpp Compiler und er kann dass nicht compilieren</p>
<pre><code class="language-cpp">#include &quot;system.h&quot;

void *memcpy(void *dest, const void *src, size_t count)
{
    const char *sp = (const char *)src;
    char *dp = (char *)dest;
    for(; count != 0; count--) *dp++ = *sp++;
    return dest;
}

int *memset(void *dest, char val, size_t count)
{
    char *temp = (char *)dest;
    for( ; count != 0; count--) *temp++ = val;
    return dest;
}

unsigned short *memsetw(unsigned short *dest, unsigned short val, size_t count)
{
    unsigned short *temp = (unsigned short *)dest;
    for( ; count != 0; count--) *temp++ = val;
    return dest;
}

size_t strlen(const char *str)
{
    size_t retval;
    for(retval = 0; *str != '\0'; str++) retval++;
    return retval;
}

unsigned char inportb (unsigned short _port)
{
    unsigned char rv;
    __asm__ __volatile__ (&quot;inb %1, %0&quot; : &quot;=a&quot; (rv) : &quot;dN&quot; (_port));
    return rv;
}

void outportb (unsigned short _port, unsigned char _data)
{
    __asm__ __volatile__ (&quot;outb %1, %0&quot; : : &quot;dN&quot; (_port), &quot;a&quot; (_data));
}

int main()
{
    int i;

    gdt_install();
    idt_install();
    isrs_install();
    irq_install();
    init_video();
    timer_install();
    keyboard_install();

    __asm__ __volatile__ (&quot;sti&quot;);

    puts(&quot;Willkommen im MF OS 1.0\n&quot;);

//    i = 10 / 0;
//    putch(i);

    for (;;);
}
</code></pre>
<p>und das ist die headerdatei</p>
<pre><code class="language-cpp">#ifndef __SYSTEM_H
#define __SYSTEM_H

typedef int size_t;

/* This defines what the stack looks like after an ISR was running */
struct regs
{
    unsigned int gs, fs, es, ds;
    unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax;
    unsigned int int_no, err_code;
    unsigned int eip, cs, eflags, useresp, ss;    
};

/* MAIN.C */
extern void *memcpy(void *dest, const void *src, size_t count);
extern void *memset(void *dest, char val, size_t count);
extern unsigned short *memsetw(unsigned short *dest, unsigned short val, size_t count);
extern size_t strlen(const char *str);
extern unsigned char inportb (unsigned short _port);
extern void outportb (unsigned short _port, unsigned char _data);

/* CONSOLE.C */
extern void init_video(void);
extern void puts(unsigned char *text);
extern void putch(unsigned char c);
extern void cls();

/* GDT.C */
extern void gdt_set_gate(int num, unsigned long base, unsigned long limit, unsigned char access, unsigned char gran);
extern void gdt_install();

/* IDT.C */
extern void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags);
extern void idt_install();

/* ISRS.C */
extern void isrs_install();

/* IRQ.C */
extern void irq_install_handler(int irq, void (*handler)(struct regs *r));
extern void irq_uninstall_handler(int irq);
extern void irq_install();

/* TIMER.C */
extern void timer_wait(int ticks);
extern void timer_install();

/* KEYBOARD.C */
extern void keyboard_install();

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1121799</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1121799</guid><dc:creator><![CDATA[OS Progger]]></dc:creator><pubDate>Mon, 21 Aug 2006 19:03:44 GMT</pubDate></item><item><title><![CDATA[Reply to OS DEV C++ on Mon, 21 Aug 2006 19:05:46 GMT]]></title><description><![CDATA[<p>OS Progger schrieb:</p>
<blockquote>
<p>Ich benütze den DevCpp Compiler und er kann dass nicht compilieren</p>
</blockquote>
<p>was meckert er denn? multiple definitions o.ä.?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1121803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1121803</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Mon, 21 Aug 2006 19:05:46 GMT</pubDate></item><item><title><![CDATA[Reply to OS DEV C++ on Mon, 21 Aug 2006 19:08:39 GMT]]></title><description><![CDATA[<p>OS Progger schrieb:</p>
<blockquote>
<p>Ich benütze den DevCpp Compiler und er kann dass nicht compilieren</p>
</blockquote>
<p>das ist keine fehlerbeschreibung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1121805</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1121805</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Mon, 21 Aug 2006 19:08:39 GMT</pubDate></item></channel></rss>