From c6d4df748c790864f57a12337b0355db02cc438a Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Sat, 9 Aug 2008 08:38:20 +0000 Subject: [PATCH] PE kernel git-svn-id: svn://kolibrios.org@849 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/kolibri_pe/data32.inc | 6 +++- kernel/branches/kolibri_pe/detect/disks.inc | 3 -- kernel/branches/kolibri_pe/kernel.asm | 21 ++++++++----- kernel/branches/kolibri_pe/ld.x | 34 +++++++++++++++++++++ 4 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 kernel/branches/kolibri_pe/ld.x diff --git a/kernel/branches/kolibri_pe/data32.inc b/kernel/branches/kolibri_pe/data32.inc index a171ba2071..5d675a5e6b 100644 --- a/kernel/branches/kolibri_pe/data32.inc +++ b/kernel/branches/kolibri_pe/data32.inc @@ -269,7 +269,11 @@ code_16: endofcode: gdte: -__edata: ;equ $-OS_BASE +edata: ;equ $-OS_BASE + +section '.bss' code readable align 4096 + +org edata align 4096 diff --git a/kernel/branches/kolibri_pe/detect/disks.inc b/kernel/branches/kolibri_pe/detect/disks.inc index 6318433c39..16e14babb3 100644 --- a/kernel/branches/kolibri_pe/detect/disks.inc +++ b/kernel/branches/kolibri_pe/detect/disks.inc @@ -11,7 +11,4 @@ $Revision$ include 'dev_fd.inc' include 'dev_hdcd.inc' include 'getcache.inc' - -; jmp __12345 include 'sear_par.inc' -;__12345: diff --git a/kernel/branches/kolibri_pe/kernel.asm b/kernel/branches/kolibri_pe/kernel.asm index e2c194ca15..5c4e6d4b14 100644 --- a/kernel/branches/kolibri_pe/kernel.asm +++ b/kernel/branches/kolibri_pe/kernel.asm @@ -1,3 +1,6 @@ + +format MS COFF + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. @@ -104,9 +107,16 @@ pci_data_sel equ (pci_data_32-gdts) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +section '.flat' code readable align 16 + +public __start + +extrn __edata use32 -org 0x100000 +org 0x001001E0 + +align 4 mboot: dd 0x1BADB002 @@ -114,7 +124,7 @@ mboot: dd -(0x1BADB002 + 0x00010003) dd mboot dd 0x100000 - dd __edata - OS_BASE + dd __edata; ;__edata - OS_BASE dd LAST_PAGE dd __start @@ -5476,10 +5486,7 @@ include "data32.inc" __REV__ = __REV -uglobals_size = $ - endofcode -diff16 "end of kernel code",0,$ +;uglobals_size = $ - endofcode +;diff16 "end of kernel code",0,$ -align 16 - -__end: diff --git a/kernel/branches/kolibri_pe/ld.x b/kernel/branches/kolibri_pe/ld.x new file mode 100644 index 0000000000..18a92d377f --- /dev/null +++ b/kernel/branches/kolibri_pe/ld.x @@ -0,0 +1,34 @@ + +ENTRY(__start) + +OUTPUT_FORMAT(pei-i386) + +SECTIONS +{ + + . = SIZEOF_HEADERS; + . = ALIGN(32); + + .flat . + __image_base__ : + { + *(.flat) + } + __edata = .; + + .bss ALIGN(4096) : + { + *(.bss) *(COMMON) + } + + /DISCARD/ : + { + *(.debug$S) + *(.debug$T) + *(.debug$F) + *(.drectve) + *(.reloc) + *(.edata) + } +} + +