mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:42:58 +00:00
buildno doesn't rewrite the include/reactos/buildno.h
Discard relocations and import table from ntoskrnl Reorganise multiboot.S svn path=/trunk/; revision=1787
This commit is contained in:
parent
db0d247af0
commit
c21076a36c
7 changed files with 90 additions and 87 deletions
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.8 2000/10/07 13:41:44 dwelch Exp $
|
# $Id: Makefile,v 1.9 2001/04/11 22:13:21 dwelch Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
PATH_TO_TOP = ../..
|
PATH_TO_TOP = ../..
|
||||||
|
@ -12,7 +12,7 @@ all: $(TARGETNAME)$(EXE_POSTFIX)
|
||||||
|
|
||||||
|
|
||||||
$(TARGETNAME)$(EXE_POSTFIX): $(TARGETNAME).c ../../include/reactos/version.h
|
$(TARGETNAME)$(EXE_POSTFIX): $(TARGETNAME).c ../../include/reactos/version.h
|
||||||
$(HOST_CC) -o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).c
|
$(HOST_CC) -g -o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: buildno.c,v 1.5 2000/12/10 16:23:15 ea Exp $
|
/* $Id: buildno.c,v 1.6 2001/04/11 22:13:21 dwelch Exp $
|
||||||
*
|
*
|
||||||
* buildno - Generate the build number for ReactOS
|
* buildno - Generate the build number for ReactOS
|
||||||
*
|
*
|
||||||
|
@ -86,71 +86,68 @@ void
|
||||||
write_h (int build)
|
write_h (int build)
|
||||||
{
|
{
|
||||||
FILE *h = NULL;
|
FILE *h = NULL;
|
||||||
|
char* s;
|
||||||
|
char* s1;
|
||||||
|
int length;
|
||||||
|
|
||||||
|
s1 = s = malloc(256 * 1024);
|
||||||
|
|
||||||
|
s = s + sprintf (s, "/* Do not edit - Machine generated */\n");
|
||||||
|
|
||||||
|
s = s + sprintf (s, "#ifndef _INC_REACTOS_BUILDNO\n" );
|
||||||
|
s = s + sprintf (s, "#define _INC_REACTOS_BUILDNO\n" );
|
||||||
|
|
||||||
|
s = s + sprintf (s, "#define KERNEL_VERSION_BUILD\t%d\n", build);
|
||||||
|
s = s + sprintf (s, "#define KERNEL_VERSION_BUILD_STR\t\"%d\"\n", build);
|
||||||
|
s = s + sprintf (s, "#define KERNEL_RELEASE_RC\t\"%d.%d.%d.%d\\0\"\n",
|
||||||
|
KERNEL_VERSION_MAJOR, KERNEL_VERSION_MINOR,
|
||||||
|
KERNEL_VERSION_PATCH_LEVEL, build);
|
||||||
|
s = s + sprintf (s, "#define KERNEL_RELEASE_STR\t\"%d.%d.%d.%d\"\n",
|
||||||
|
KERNEL_VERSION_MAJOR,
|
||||||
|
KERNEL_VERSION_MINOR,
|
||||||
|
KERNEL_VERSION_PATCH_LEVEL,
|
||||||
|
build);
|
||||||
|
s = s + sprintf (s, "#define KERNEL_VERSION_RC\t\"%d.%d.%d\\0\"\n",
|
||||||
|
KERNEL_VERSION_MAJOR,
|
||||||
|
KERNEL_VERSION_MINOR,
|
||||||
|
KERNEL_VERSION_PATCH_LEVEL);
|
||||||
|
s = s + sprintf (s, "#define KERNEL_VERSION_STR\t\"%d.%d.%d\"\n",
|
||||||
|
KERNEL_VERSION_MAJOR,
|
||||||
|
KERNEL_VERSION_MINOR,
|
||||||
|
KERNEL_VERSION_PATCH_LEVEL);
|
||||||
|
s = s + sprintf (s, "#endif\n/* EOF */\n");
|
||||||
|
|
||||||
|
h = fopen (BUILDNO_INCLUDE_FILE, "r");
|
||||||
|
if (h != NULL)
|
||||||
|
{
|
||||||
|
fseek(h, 0, SEEK_END);
|
||||||
|
length = ftell(h);
|
||||||
|
if (length == strlen(s1))
|
||||||
|
{
|
||||||
|
char* orig;
|
||||||
|
|
||||||
|
orig = malloc(length);
|
||||||
|
fseek(h, 0, SEEK_SET);
|
||||||
|
fread(orig, 1, length, h);
|
||||||
|
if (memcmp(s1, orig, length) == 0)
|
||||||
|
{
|
||||||
|
fclose(h);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(h);
|
||||||
|
}
|
||||||
|
|
||||||
h = fopen (BUILDNO_INCLUDE_FILE, "w");
|
h = fopen (BUILDNO_INCLUDE_FILE, "w");
|
||||||
if (!h)
|
if (!h)
|
||||||
{
|
{
|
||||||
fprintf (
|
fprintf (stderr,
|
||||||
stderr,
|
|
||||||
"%s: can not create file \"%s\"!\n",
|
"%s: can not create file \"%s\"!\n",
|
||||||
argv0,
|
argv0,
|
||||||
BUILDNO_INCLUDE_FILE
|
BUILDNO_INCLUDE_FILE);
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fprintf (
|
fwrite(s1, 1, strlen(s1), h);
|
||||||
h,
|
|
||||||
"/* Do not edit - Machine generated */\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
fprintf (h, "#ifndef _INC_REACTOS_BUILDNO\n" );
|
|
||||||
fprintf (h, "#define _INC_REACTOS_BUILDNO\n" );
|
|
||||||
|
|
||||||
fprintf (
|
|
||||||
h,
|
|
||||||
"#define KERNEL_VERSION_BUILD\t%d\n",
|
|
||||||
build
|
|
||||||
);
|
|
||||||
fprintf (
|
|
||||||
h,
|
|
||||||
"#define KERNEL_VERSION_BUILD_STR\t\"%d\"\n",
|
|
||||||
build
|
|
||||||
);
|
|
||||||
fprintf (
|
|
||||||
h,
|
|
||||||
"#define KERNEL_RELEASE_RC\t\"%d.%d.%d.%d\\0\"\n",
|
|
||||||
KERNEL_VERSION_MAJOR,
|
|
||||||
KERNEL_VERSION_MINOR,
|
|
||||||
KERNEL_VERSION_PATCH_LEVEL,
|
|
||||||
build
|
|
||||||
);
|
|
||||||
fprintf (
|
|
||||||
h,
|
|
||||||
"#define KERNEL_RELEASE_STR\t\"%d.%d.%d.%d\"\n",
|
|
||||||
KERNEL_VERSION_MAJOR,
|
|
||||||
KERNEL_VERSION_MINOR,
|
|
||||||
KERNEL_VERSION_PATCH_LEVEL,
|
|
||||||
build
|
|
||||||
);
|
|
||||||
fprintf (
|
|
||||||
h,
|
|
||||||
"#define KERNEL_VERSION_RC\t\"%d.%d.%d\\0\"\n",
|
|
||||||
KERNEL_VERSION_MAJOR,
|
|
||||||
KERNEL_VERSION_MINOR,
|
|
||||||
KERNEL_VERSION_PATCH_LEVEL
|
|
||||||
);
|
|
||||||
fprintf (
|
|
||||||
h,
|
|
||||||
"#define KERNEL_VERSION_STR\t\"%d.%d.%d\"\n",
|
|
||||||
KERNEL_VERSION_MAJOR,
|
|
||||||
KERNEL_VERSION_MINOR,
|
|
||||||
KERNEL_VERSION_PATCH_LEVEL
|
|
||||||
);
|
|
||||||
fprintf (
|
|
||||||
h,
|
|
||||||
"#endif\n/* EOF */\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
fclose (h);
|
fclose (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.32 2001/04/10 22:13:22 dwelch Exp $
|
# $Id: Makefile,v 1.33 2001/04/11 22:13:21 dwelch Exp $
|
||||||
#
|
#
|
||||||
# ReactOS Operating System
|
# ReactOS Operating System
|
||||||
#
|
#
|
||||||
|
@ -524,7 +524,7 @@ $(TARGETNAME).nostrip.exe: $(TARGETNAME).o $(TARGETNAME).a $(IE_DATA)
|
||||||
$(TARGETNAME).o -lgcc
|
$(TARGETNAME).o -lgcc
|
||||||
- $(RM) temp.exp
|
- $(RM) temp.exp
|
||||||
|
|
||||||
$(TARGETNAME).exe: $(TARGETNAME).o $(TARGETNAME).a
|
$(TARGETNAME).exe: $(TARGETNAME).o $(TARGETNAME).a $(TARGETNAME).lnk
|
||||||
$(CC) \
|
$(CC) \
|
||||||
-Wl,-T,ntoskrnl.lnk \
|
-Wl,-T,ntoskrnl.lnk \
|
||||||
-nostartfiles -nostdlib \
|
-nostartfiles -nostdlib \
|
||||||
|
|
|
@ -49,6 +49,12 @@ USHORT KiGdt[11 * 4] =
|
||||||
0x0, 0x0, 0x0, 0x0 /* Trap TSS */
|
0x0, 0x0, 0x0, 0x0 /* Trap TSS */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
USHORT Length;
|
||||||
|
ULONG Base;
|
||||||
|
} __attribute__((packed)) KiGdtDescriptor = { 11 * 8, (ULONG)KiGdt };
|
||||||
|
|
||||||
static KSPIN_LOCK GdtLock;
|
static KSPIN_LOCK GdtLock;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
|
@ -19,5 +19,13 @@
|
||||||
|
|
||||||
IDT_DESCRIPTOR KiIdt[256];
|
IDT_DESCRIPTOR KiIdt[256];
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
USHORT Length;
|
||||||
|
ULONG Base;
|
||||||
|
} __attribute__((packed)) KiIdtDescriptor = {256 * 8, (ULONG)KiIdt};
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -100,8 +100,8 @@ _multiboot_entry:
|
||||||
* Load the GDTR and IDTR with new tables located above
|
* Load the GDTR and IDTR with new tables located above
|
||||||
* 0xc0000000
|
* 0xc0000000
|
||||||
*/
|
*/
|
||||||
lgdt _gdt_descr
|
lgdt _KiGdtDescriptor
|
||||||
lidt _idt_descr
|
lidt _KiIdtDescriptor
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reload the data segment registers
|
* Reload the data segment registers
|
||||||
|
@ -658,6 +658,7 @@ lowmem_pagetable:
|
||||||
.long 0x3f0007,0x3f1007,0x3f2007,0x3f3007,0x3f4007,0x3f5007,0x3f6007,0x3f7007
|
.long 0x3f0007,0x3f1007,0x3f2007,0x3f3007,0x3f4007,0x3f5007,0x3f6007,0x3f7007
|
||||||
.long 0x3f8007,0x3f9007,0x3fa007,0x3fb007,0x3fc007,0x3fd007,0x3fe007,0x3ff007
|
.long 0x3f8007,0x3f9007,0x3fa007,0x3fb007,0x3fc007,0x3fd007,0x3fe007,0x3ff007
|
||||||
|
|
||||||
|
.bss
|
||||||
_unmap_me:
|
_unmap_me:
|
||||||
.fill 4096, 1, 0
|
.fill 4096, 1, 0
|
||||||
|
|
||||||
|
@ -675,11 +676,4 @@ _trap_stack_top:
|
||||||
_unmap_me3:
|
_unmap_me3:
|
||||||
.fill 4096, 1, 0
|
.fill 4096, 1, 0
|
||||||
|
|
||||||
_gdt_descr:
|
|
||||||
.word (11*8)-1
|
|
||||||
.long _KiGdt
|
|
||||||
|
|
||||||
_idt_descr:
|
|
||||||
.word (256*8)-1
|
|
||||||
.long _KiIdt
|
|
||||||
|
|
||||||
|
|
|
@ -51,14 +51,14 @@ SECTIONS
|
||||||
*(.debug$F)
|
*(.debug$F)
|
||||||
*(.drectve)
|
*(.drectve)
|
||||||
}
|
}
|
||||||
.idata BLOCK(__section_alignment__) :
|
/DISCARD/ :
|
||||||
{
|
{
|
||||||
/* This cannot currently be handled with grouped sections.
|
/* This cannot currently be handled with grouped sections.
|
||||||
See pe.em:sort_sections. */
|
See pe.em:sort_sections. */
|
||||||
SORT(*)(.idata$2)
|
SORT(*)(.idata$2)
|
||||||
SORT(*)(.idata$3)
|
SORT(*)(.idata$3)
|
||||||
/* These zeroes mark the end of the import list. */
|
/* These zeroes mark the end of the import list. */
|
||||||
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
|
/* LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);*/
|
||||||
SORT(*)(.idata$4)
|
SORT(*)(.idata$4)
|
||||||
SORT(*)(.idata$5)
|
SORT(*)(.idata$5)
|
||||||
SORT(*)(.idata$6)
|
SORT(*)(.idata$6)
|
||||||
|
@ -80,12 +80,10 @@ SECTIONS
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
__bss_end__ = . ;
|
__bss_end__ = . ;
|
||||||
}
|
}
|
||||||
/*
|
/DISCARD/ :
|
||||||
.reloc BLOCK(__section_alignment__) :
|
|
||||||
{
|
{
|
||||||
*(.reloc)
|
*(.reloc)
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
.stab BLOCK(__section_alignment__) (NOLOAD) :
|
.stab BLOCK(__section_alignment__) (NOLOAD) :
|
||||||
{
|
{
|
||||||
[ .stab ]
|
[ .stab ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue