Page 1 of 1

gcc and os compiling

Posted: Tue Feb 25, 2003 12:19 pm
by eL JeDi
Hi averyone,

I get some error when try to compile my os.


../include/stdio.h:65: storage class specified for parameter `screenw'
../include/stdio.h:65: storage class specified for parameter `screenh'
../include/stdio.h:74: storage class specified for parameter `ClrScr'

I have this on stdio.h:

extern unsigned screenw, screenh;

And this on stdio.c

unsigned screenw, screenh;

And a declaration for the funtions are like this

ints.h:63: warning: structure defined inside parms
ints.h:63: storage class specified for parameter `IDT_entry'

I have this on ints.h:

typedef struct
{
   unsigned short   offset1;
   unsigned short   selector;
   unsigned short   access;
   unsigned short   offset2;
}IDT_entry;

extern IDT_entry *pto_idt;

And this on ints.c:

IDT_entry *pto_idt = (IDT_entry *) 0x600;

The list of error are large, and all are like Those.

Can anyone help me??

Thanks for all.

Re:gcc and os compiling

Posted: Tue Feb 25, 2003 1:19 pm
by Tim
Judging by the errors, you've opened a bracket in a function declaration but not closed it. Maybe your code looks like this:

Code: Select all

void some_function(int blah,

extern unsigned screenw, screenh;

typedef struct
{
   unsigned short   offset1;
   unsigned short   selector;
   unsigned short   access;
   unsigned short   offset2;
}IDT_entry;

Re:gcc and os compiling

Posted: Wed Feb 26, 2003 11:55 am
by eL JeDi
Hi tim,

Well, this structures are global structures. And i declarate them before all functions.

Here are my ints.c

Code: Select all

#include "ints.h"


// Puntero a la IDT
IDT_entry *pto_idt = (IDT_entry *) 0x600;

////////////////////////////////////////////////////////////////////
// FUNCIONES
////////////////////////////////////////////////////////////////////


// Estable una puerta de la IDT
void set_idt_entry(dword pto_dir, dword inum)
{
   pto_idt[inum].offset1 = (word)pto_dir;
   pto_idt[inum].offset2 = (pto_dir >> 16);
};



// Remapea las IRQs
void remap_pics(int pic1, int pic2)
{
   byte a1, a2;

   a1=inportb(PIC1_DATA);
   a2=inportb(PIC2_DATA);

   outportb(PIC1_COMMAND, ICW1_INIT+ICW1_ICW4);
   outportb(PIC2_COMMAND, ICW1_INIT+ICW1_ICW4);
   outportb(PIC1_DATA, pic1);
   outportb(PIC2_DATA, pic2);
   outportb(PIC1_DATA, 4);
   outportb(PIC2_DATA, 2);
   outportb(PIC1_DATA, ICW4_8086);
   outportb(PIC2_DATA, ICW4_8086);

   outportb(PIC1_DATA, a1);
   outportb(PIC2_DATA, a2);
};
and here my ints.h

Code: Select all

#ifndef __INTS__H__
#define __INTS__H__


#include "../include/types.h"


////////////////////////////////////////////////////////////////////
// DEFINES
////////////////////////////////////////////////////////////////////

// Direcciones de los pics
#define   PIC1      0x20
#define   PIC2      0xA0
#define   PIC1_COMMAND   PIC1
#define   PIC1_DATA   (PIC1+1)
#define   PIC2_COMMAND   PIC2
#define   PIC2_DATA   (PIC2+1)
#define   PIC_EOI      0x20

// Comandos
#define   ICW1_ICW4   0x01      /* ICW4 (not) needed */
#define   ICW1_SINGLE   0x02      /* Single (cascade) mode */
#define   ICW1_INTERVAL4   0x04      /* Call address interval 4 (8) */
#define   ICW1_LEVEL   0x08      /* Level triggered (edge) mode */
#define   ICW1_INIT   0x10      /* Initialization - required! */

#define   ICW4_8086   0x01      /* 8086/88 (MCS-80/85) mode */
With these files I get this errors:

ints.h:63: warning: structure defined inside parms
ints.h:63: storage class specified for parameter `IDT_entry'
ints.h:67: storage class specified for parameter `IDT_entry'
ints.h:67: conflicting types for `IDT_entry'
ints.h:63: previous declaration of `IDT_entry'



And thats only and example, 'cos i get the same errors on other files when try to compile my os completly.


Thanks for all.

Re:gcc and os compiling

Posted: Wed Feb 26, 2003 4:20 pm
by chrisa128

Code: Select all

#include "../include/types.h"
I take this is where you declared 'IDT_entry', as this is the structure giving the problems it is in this file your problems lay.

Have a look at "types.h" for open brackets ect

Once you sort out this file then all the other problems like this will vanish :)