mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 21:11:03 +03:00
[i386] Add explicit flags and type on all .section declarations
Try to avoid future problems caused by implicit section flags and/or
type information by instituting a policy that all .section
declarations must explicitly state the flags and type.
Most of this change was achieved using
perl -pi \
-e 's/".text"$/".text", "ax", \@progbits/ ; ' \
-e 's/".text16"$/".text16", "ax", \@progbits/ ; ' \
-e 's/".text16.null"$/".text16.null", "ax", \@progbits/ ; ' \
-e 's/".text16.data"$/".text16.data", "aw", \@progbits/ ; ' \
-e 's/".data"$/".data", "aw", \@progbits/ ; ' \
-e 's/".data16"$/".data16", "aw", \@progbits/ ; ' \
-e 's/".bss"$/".bss", "aw", \@nobits/ ; ' \
-e 's/".bss16"$/".bss16", "aw", \@nobits/ ; ' \
-e 's/".prefix"$/".prefix", "ax", \@progbits/ ; ' \
-e 's/".prefix.lib"$/".prefix.lib", "awx", \@progbits/ ; ' \
-e 's/".prefix.data"$/".prefix.data", "aw", \@progbits/ ; ' \
-e 's/".weak"$/".weak", "a", \@nobits/ ; ' \
`git grep -l '\.section'`
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
* Interrupt Descriptor Table
|
* Interrupt Descriptor Table
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
.globl idtr
|
.globl idtr
|
||||||
idtr:
|
idtr:
|
||||||
idt_limit:
|
idt_limit:
|
||||||
@@ -68,7 +68,7 @@ idt_fixed:
|
|||||||
* Destroys %ax, %bx, and %di.
|
* Destroys %ax, %bx, and %di.
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl idt_init
|
.globl idt_init
|
||||||
idt_init:
|
idt_init:
|
||||||
@@ -100,7 +100,7 @@ idt_init:
|
|||||||
* Interrupt handlers
|
* Interrupt handlers
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text"
|
.section ".text", "ax", @progbits
|
||||||
.code32
|
.code32
|
||||||
|
|
||||||
/* POSIX signal numbers for reporting traps to GDB */
|
/* POSIX signal numbers for reporting traps to GDB */
|
||||||
|
|||||||
@@ -10,11 +10,9 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
.arch i386
|
.arch i386
|
||||||
.section ".text16", "ax", @progbits
|
|
||||||
.section ".data16", "aw", @progbits
|
|
||||||
.code16
|
.code16
|
||||||
|
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.globl undiisr
|
.globl undiisr
|
||||||
undiisr:
|
undiisr:
|
||||||
|
|
||||||
@@ -75,7 +73,7 @@ exit: /* Restore registers and return */
|
|||||||
popw %ds
|
popw %ds
|
||||||
iret
|
iret
|
||||||
|
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
undinet_params:
|
undinet_params:
|
||||||
status: .word 0
|
status: .word 0
|
||||||
funcflag: .word 0
|
funcflag: .word 0
|
||||||
|
|||||||
@@ -18,9 +18,6 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
.arch i386
|
.arch i386
|
||||||
.section ".text16", "ax", @progbits
|
|
||||||
.section ".data16", "aw", @progbits
|
|
||||||
.section ".text16.data", "aw", @progbits
|
|
||||||
.code16
|
.code16
|
||||||
|
|
||||||
#define SMAP 0x534d4150
|
#define SMAP 0x534d4150
|
||||||
@@ -62,7 +59,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
.align 16
|
.align 16
|
||||||
.globl hidemem_base
|
.globl hidemem_base
|
||||||
.globl hidemem_umalloc
|
.globl hidemem_umalloc
|
||||||
@@ -94,7 +91,7 @@ memory_windows_end:
|
|||||||
* %ecx:%ebx Length of windowed region
|
* %ecx:%ebx Length of windowed region
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
window_region:
|
window_region:
|
||||||
/* Convert (start,len) to (start, end) */
|
/* Convert (start,len) to (start, end) */
|
||||||
addl %eax, %ebx
|
addl %eax, %ebx
|
||||||
@@ -132,7 +129,7 @@ window_region:
|
|||||||
* %ax Modified memory above 1M in 1kB blocks
|
* %ax Modified memory above 1M in 1kB blocks
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
patch_1m:
|
patch_1m:
|
||||||
pushal
|
pushal
|
||||||
/* Convert to (start,len) format and call truncate */
|
/* Convert to (start,len) format and call truncate */
|
||||||
@@ -162,7 +159,7 @@ patch_1m:
|
|||||||
* %bx Modified memory above 16M in 64kB blocks
|
* %bx Modified memory above 16M in 64kB blocks
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
patch_16m:
|
patch_16m:
|
||||||
pushal
|
pushal
|
||||||
/* Convert to (start,len) format and call truncate */
|
/* Convert to (start,len) format and call truncate */
|
||||||
@@ -193,7 +190,7 @@ patch_16m:
|
|||||||
* %bx Modified memory above 16MB, in 64kB blocks
|
* %bx Modified memory above 16MB, in 64kB blocks
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
patch_1m_16m:
|
patch_1m_16m:
|
||||||
call patch_1m
|
call patch_1m
|
||||||
call patch_16m
|
call patch_16m
|
||||||
@@ -219,7 +216,7 @@ patch_1m_16m:
|
|||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
get_underlying_e820:
|
get_underlying_e820:
|
||||||
|
|
||||||
/* If the requested region is in the cache, return it */
|
/* If the requested region is in the cache, return it */
|
||||||
@@ -308,22 +305,22 @@ get_underlying_e820:
|
|||||||
jmp get_underlying_e820
|
jmp get_underlying_e820
|
||||||
.size get_underlying_e820, . - get_underlying_e820
|
.size get_underlying_e820, . - get_underlying_e820
|
||||||
|
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
underlying_e820_index:
|
underlying_e820_index:
|
||||||
.word 0xffff /* Initialise to an invalid value */
|
.word 0xffff /* Initialise to an invalid value */
|
||||||
.size underlying_e820_index, . - underlying_e820_index
|
.size underlying_e820_index, . - underlying_e820_index
|
||||||
|
|
||||||
.section ".bss16"
|
.section ".bss16", "aw", @nobits
|
||||||
underlying_e820_ebx:
|
underlying_e820_ebx:
|
||||||
.long 0
|
.long 0
|
||||||
.size underlying_e820_ebx, . - underlying_e820_ebx
|
.size underlying_e820_ebx, . - underlying_e820_ebx
|
||||||
|
|
||||||
.section ".bss16"
|
.section ".bss16", "aw", @nobits
|
||||||
underlying_e820_cache:
|
underlying_e820_cache:
|
||||||
.space E820MAXSIZE
|
.space E820MAXSIZE
|
||||||
.size underlying_e820_cache, . - underlying_e820_cache
|
.size underlying_e820_cache, . - underlying_e820_cache
|
||||||
|
|
||||||
.section ".bss16"
|
.section ".bss16", "aw", @nobits
|
||||||
underlying_e820_cache_size:
|
underlying_e820_cache_size:
|
||||||
.long 0
|
.long 0
|
||||||
.size underlying_e820_cache_size, . - underlying_e820_cache_size
|
.size underlying_e820_cache_size, . - underlying_e820_cache_size
|
||||||
@@ -342,7 +339,7 @@ underlying_e820_cache_size:
|
|||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
get_windowed_e820:
|
get_windowed_e820:
|
||||||
|
|
||||||
/* Preserve registers */
|
/* Preserve registers */
|
||||||
@@ -417,7 +414,7 @@ get_windowed_e820:
|
|||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
get_nonempty_e820:
|
get_nonempty_e820:
|
||||||
|
|
||||||
/* Record entry parameters */
|
/* Record entry parameters */
|
||||||
@@ -462,7 +459,7 @@ get_nonempty_e820:
|
|||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
get_mangled_e820:
|
get_mangled_e820:
|
||||||
|
|
||||||
/* Get a nonempty region */
|
/* Get a nonempty region */
|
||||||
@@ -496,7 +493,7 @@ get_mangled_e820:
|
|||||||
* INT 15,e820 handler
|
* INT 15,e820 handler
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
int15_e820:
|
int15_e820:
|
||||||
pushw %ds
|
pushw %ds
|
||||||
pushw %cs:rm_ds
|
pushw %cs:rm_ds
|
||||||
@@ -510,7 +507,7 @@ int15_e820:
|
|||||||
* INT 15,e801 handler
|
* INT 15,e801 handler
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
int15_e801:
|
int15_e801:
|
||||||
/* Call previous handler */
|
/* Call previous handler */
|
||||||
pushfw
|
pushfw
|
||||||
@@ -536,7 +533,7 @@ int15_e801:
|
|||||||
* INT 15,88 handler
|
* INT 15,88 handler
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
int15_88:
|
int15_88:
|
||||||
/* Call previous handler */
|
/* Call previous handler */
|
||||||
pushfw
|
pushfw
|
||||||
@@ -557,7 +554,7 @@ int15_88:
|
|||||||
* INT 15 handler
|
* INT 15 handler
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.globl int15
|
.globl int15
|
||||||
int15:
|
int15:
|
||||||
/* See if we want to intercept this call */
|
/* See if we want to intercept this call */
|
||||||
@@ -580,7 +577,7 @@ int15:
|
|||||||
ljmp *%cs:int15_vector
|
ljmp *%cs:int15_vector
|
||||||
.size int15, . - int15
|
.size int15, . - int15
|
||||||
|
|
||||||
.section ".text16.data"
|
.section ".text16.data", "aw", @progbits
|
||||||
.globl int15_vector
|
.globl int15_vector
|
||||||
int15_vector:
|
int15_vector:
|
||||||
.long 0
|
.long 0
|
||||||
|
|||||||
@@ -18,15 +18,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.arch i386
|
.arch i386
|
||||||
.section ".text16", "awx", @progbits
|
|
||||||
.section ".text16.data", "aw", @progbits
|
|
||||||
.section ".data16", "aw", @progbits
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* !PXE structure
|
* !PXE structure
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16.data"
|
.section ".text16.data", "aw", @progbits
|
||||||
.globl ppxe
|
.globl ppxe
|
||||||
.align 16
|
.align 16
|
||||||
ppxe:
|
ppxe:
|
||||||
@@ -56,7 +53,7 @@ pxe_segments:
|
|||||||
.size ppxe, . - ppxe
|
.size ppxe, . - ppxe
|
||||||
|
|
||||||
/* Define undiheader=0 as a weak symbol for non-ROM builds */
|
/* Define undiheader=0 as a weak symbol for non-ROM builds */
|
||||||
.section ".weak"
|
.section ".weak", "a", @nobits
|
||||||
.weak undiheader
|
.weak undiheader
|
||||||
undiheader:
|
undiheader:
|
||||||
|
|
||||||
@@ -64,7 +61,7 @@ undiheader:
|
|||||||
* PXENV+ structure
|
* PXENV+ structure
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16.data"
|
.section ".text16.data", "aw", @progbits
|
||||||
.globl pxenv
|
.globl pxenv
|
||||||
.align 16
|
.align 16
|
||||||
pxenv:
|
pxenv:
|
||||||
@@ -108,12 +105,12 @@ pxenv:
|
|||||||
* somebody at Wyse has difficulty distinguishing between the
|
* somebody at Wyse has difficulty distinguishing between the
|
||||||
* words "may" and "must"...
|
* words "may" and "must"...
|
||||||
*/
|
*/
|
||||||
.section ".text16.null"
|
.section ".text16.null", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
pxenv_null_entry:
|
pxenv_null_entry:
|
||||||
jmp pxenv_entry
|
jmp pxenv_entry
|
||||||
|
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
pxenv_entry:
|
pxenv_entry:
|
||||||
pushl $pxe_api_call
|
pushl $pxe_api_call
|
||||||
@@ -137,7 +134,7 @@ pxenv_entry:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
pxe_entry:
|
pxe_entry:
|
||||||
pxe_entry_sp:
|
pxe_entry_sp:
|
||||||
@@ -186,7 +183,7 @@ pxe_entry_common:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl pxe_int_1a
|
.globl pxe_int_1a
|
||||||
pxe_int_1a:
|
pxe_int_1a:
|
||||||
@@ -205,6 +202,6 @@ pxe_int_1a:
|
|||||||
popfw
|
popfw
|
||||||
ljmp *%cs:pxe_int_1a_vector
|
ljmp *%cs:pxe_int_1a_vector
|
||||||
|
|
||||||
.section ".text16.data"
|
.section ".text16.data", "aw", @progbits
|
||||||
.globl pxe_int_1a_vector
|
.globl pxe_int_1a_vector
|
||||||
pxe_int_1a_vector: .long 0
|
pxe_int_1a_vector: .long 0
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.arch i386
|
.arch i386
|
||||||
.section ".prefix.lib", "awx", @progbits
|
|
||||||
.section ".data16", "aw", @progbits
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* High memory temporary load address
|
* High memory temporary load address
|
||||||
@@ -53,7 +51,7 @@
|
|||||||
* %ds:di : next character in output buffer (if applicable)
|
* %ds:di : next character in output buffer (if applicable)
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl print_character
|
.globl print_character
|
||||||
print_character:
|
print_character:
|
||||||
@@ -93,7 +91,7 @@ print_character:
|
|||||||
* %ds:di : next character in output buffer (if applicable)
|
* %ds:di : next character in output buffer (if applicable)
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl print_message
|
.globl print_message
|
||||||
print_message:
|
print_message:
|
||||||
@@ -123,7 +121,7 @@ print_message:
|
|||||||
* %ds:di : next character in output buffer (if applicable)
|
* %ds:di : next character in output buffer (if applicable)
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl print_hex_dword
|
.globl print_hex_dword
|
||||||
print_hex_dword:
|
print_hex_dword:
|
||||||
@@ -171,7 +169,7 @@ print_hex_nibble:
|
|||||||
* %ds:di : next character in output buffer (if applicable)
|
* %ds:di : next character in output buffer (if applicable)
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl print_pci_busdevfn
|
.globl print_pci_busdevfn
|
||||||
print_pci_busdevfn:
|
print_pci_busdevfn:
|
||||||
@@ -208,7 +206,7 @@ print_pci_busdevfn:
|
|||||||
* %ds:di : next character in output buffer (if applicable)
|
* %ds:di : next character in output buffer (if applicable)
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl print_kill_line
|
.globl print_kill_line
|
||||||
print_kill_line:
|
print_kill_line:
|
||||||
@@ -256,7 +254,7 @@ print_kill_line:
|
|||||||
#ifndef KEEP_IT_REAL
|
#ifndef KEEP_IT_REAL
|
||||||
|
|
||||||
/* GDT for protected-mode calls */
|
/* GDT for protected-mode calls */
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.align 16
|
.align 16
|
||||||
pm_call_vars:
|
pm_call_vars:
|
||||||
gdt:
|
gdt:
|
||||||
@@ -279,7 +277,7 @@ gdt_end:
|
|||||||
.equ gdt_length, . - gdt
|
.equ gdt_length, . - gdt
|
||||||
.size gdt, . - gdt
|
.size gdt, . - gdt
|
||||||
|
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.align 16
|
.align 16
|
||||||
pm_saved_gdt:
|
pm_saved_gdt:
|
||||||
.long 0, 0
|
.long 0, 0
|
||||||
@@ -288,7 +286,7 @@ pm_saved_gdt:
|
|||||||
.equ pm_call_vars_size, . - pm_call_vars
|
.equ pm_call_vars_size, . - pm_call_vars
|
||||||
#define PM_CALL_VAR(x) ( -pm_call_vars_size + ( (x) - pm_call_vars ) )
|
#define PM_CALL_VAR(x) ( -pm_call_vars_size + ( (x) - pm_call_vars ) )
|
||||||
|
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
pm_call:
|
pm_call:
|
||||||
/* Preserve registers, flags, and RM return point */
|
/* Preserve registers, flags, and RM return point */
|
||||||
@@ -411,7 +409,7 @@ set_seg_base:
|
|||||||
* None
|
* None
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
copy_bytes:
|
copy_bytes:
|
||||||
pushl %ecx
|
pushl %ecx
|
||||||
@@ -436,7 +434,7 @@ copy_bytes:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
install_block:
|
install_block:
|
||||||
|
|
||||||
@@ -533,7 +531,7 @@ install_block:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl alloc_basemem
|
.globl alloc_basemem
|
||||||
alloc_basemem:
|
alloc_basemem:
|
||||||
@@ -581,7 +579,7 @@ alloc_basemem:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl free_basemem
|
.globl free_basemem
|
||||||
free_basemem:
|
free_basemem:
|
||||||
@@ -613,7 +611,7 @@ free_basemem:
|
|||||||
ret
|
ret
|
||||||
.size free_basemem, . - free_basemem
|
.size free_basemem, . - free_basemem
|
||||||
|
|
||||||
.section ".text16.data"
|
.section ".text16.data", "aw", @progbits
|
||||||
.globl hooked_bios_interrupts
|
.globl hooked_bios_interrupts
|
||||||
hooked_bios_interrupts:
|
hooked_bios_interrupts:
|
||||||
.word 0
|
.word 0
|
||||||
@@ -633,7 +631,7 @@ hooked_bios_interrupts:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl install
|
.globl install
|
||||||
install:
|
install:
|
||||||
@@ -668,7 +666,7 @@ install:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix.lib"
|
.section ".prefix.lib", "awx", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl install_prealloc
|
.globl install_prealloc
|
||||||
install_prealloc:
|
install_prealloc:
|
||||||
@@ -750,7 +748,7 @@ install_prealloc:
|
|||||||
.size install_prealloc, . - install_prealloc
|
.size install_prealloc, . - install_prealloc
|
||||||
|
|
||||||
/* Vectors for far calls to .text16 functions */
|
/* Vectors for far calls to .text16 functions */
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
#ifdef KEEP_IT_REAL
|
#ifdef KEEP_IT_REAL
|
||||||
init_libkir_vector:
|
init_libkir_vector:
|
||||||
.word init_libkir
|
.word init_libkir
|
||||||
@@ -781,7 +779,7 @@ prot_call_vector:
|
|||||||
* none
|
* none
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl uninstall
|
.globl uninstall
|
||||||
uninstall:
|
uninstall:
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
.text
|
.text
|
||||||
.arch i386
|
.arch i386
|
||||||
.section ".prefix", "ax", @progbits
|
|
||||||
.section ".prefix.data", "aw", @progbits
|
|
||||||
.code16
|
.code16
|
||||||
.section ".prefix"
|
.section ".prefix", "ax", @progbits
|
||||||
.org 0
|
.org 0
|
||||||
|
|
||||||
nbi_header:
|
nbi_header:
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
.text
|
.text
|
||||||
.arch i386
|
.arch i386
|
||||||
.org 0
|
.org 0
|
||||||
.section ".prefix", "ax", @progbits
|
|
||||||
.section ".prefix.data", "aw", @progbits
|
|
||||||
.code16
|
.code16
|
||||||
|
|
||||||
#include <undi.h>
|
#include <undi.h>
|
||||||
@@ -16,7 +14,7 @@
|
|||||||
* Entry point: set operating context, print welcome message
|
* Entry point: set operating context, print welcome message
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".prefix"
|
.section ".prefix", "ax", @progbits
|
||||||
/* Set up our non-stack segment registers */
|
/* Set up our non-stack segment registers */
|
||||||
jmp $0x7c0, $1f
|
jmp $0x7c0, $1f
|
||||||
1: movw %cs, %ax
|
1: movw %cs, %ax
|
||||||
@@ -39,7 +37,7 @@
|
|||||||
movw $10f, %si
|
movw $10f, %si
|
||||||
xorw %di, %di
|
xorw %di, %di
|
||||||
call print_message
|
call print_message
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz "PXE->EB:"
|
10: .asciz "PXE->EB:"
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
@@ -70,7 +68,7 @@ detect_pxenv:
|
|||||||
movb $',', %al
|
movb $',', %al
|
||||||
call print_character
|
call print_character
|
||||||
jmp 99f
|
jmp 99f
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " PXENV+ at "
|
10: .asciz " PXENV+ at "
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
@@ -108,7 +106,7 @@ detect_ppxe:
|
|||||||
movb $',', %al
|
movb $',', %al
|
||||||
call print_character
|
call print_character
|
||||||
jmp 99f
|
jmp 99f
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " !PXE at "
|
10: .asciz " !PXE at "
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
@@ -131,7 +129,7 @@ check_have_stack:
|
|||||||
movw $10f, %si
|
movw $10f, %si
|
||||||
call print_message
|
call print_message
|
||||||
jmp finished
|
jmp finished
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " No PXE stack found!\n"
|
10: .asciz " No PXE stack found!\n"
|
||||||
.previous
|
.previous
|
||||||
99:
|
99:
|
||||||
@@ -169,7 +167,7 @@ print_structure_information:
|
|||||||
call print_message
|
call print_message
|
||||||
les entry_segoff, %bx
|
les entry_segoff, %bx
|
||||||
call print_segoff
|
call print_segoff
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " entry point at "
|
10: .asciz " entry point at "
|
||||||
.previous
|
.previous
|
||||||
/* Print UNDI code segment */
|
/* Print UNDI code segment */
|
||||||
@@ -177,7 +175,7 @@ print_structure_information:
|
|||||||
call print_message
|
call print_message
|
||||||
les undi_code_segoff, %bx
|
les undi_code_segoff, %bx
|
||||||
call print_segoff
|
call print_segoff
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz "\n UNDI code segment "
|
10: .asciz "\n UNDI code segment "
|
||||||
.previous
|
.previous
|
||||||
/* Print UNDI data segment */
|
/* Print UNDI data segment */
|
||||||
@@ -185,7 +183,7 @@ print_structure_information:
|
|||||||
call print_message
|
call print_message
|
||||||
les undi_data_segoff, %bx
|
les undi_data_segoff, %bx
|
||||||
call print_segoff
|
call print_segoff
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz ", data segment "
|
10: .asciz ", data segment "
|
||||||
.previous
|
.previous
|
||||||
/* Print UNDI memory usage */
|
/* Print UNDI memory usage */
|
||||||
@@ -199,7 +197,7 @@ print_structure_information:
|
|||||||
call print_word
|
call print_word
|
||||||
movw $20f, %si
|
movw $20f, %si
|
||||||
call print_message
|
call print_message
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " ("
|
10: .asciz " ("
|
||||||
20: .asciz "kB)\n"
|
20: .asciz "kB)\n"
|
||||||
.previous
|
.previous
|
||||||
@@ -233,7 +231,7 @@ pci_physical_device:
|
|||||||
movb $0x0a, %al
|
movb $0x0a, %al
|
||||||
call print_character
|
call print_character
|
||||||
jmp 99f
|
jmp 99f
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " UNDI device is PCI "
|
10: .asciz " UNDI device is PCI "
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
@@ -241,7 +239,7 @@ no_physical_device:
|
|||||||
/* No device found, or device type not understood */
|
/* No device found, or device type not understood */
|
||||||
movw $10f, %si
|
movw $10f, %si
|
||||||
call print_message
|
call print_message
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " Unable to determine UNDI physical device\n"
|
10: .asciz " Unable to determine UNDI physical device\n"
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
@@ -308,7 +306,7 @@ print_free_basemem:
|
|||||||
call print_word
|
call print_word
|
||||||
movw $20f, %si
|
movw $20f, %si
|
||||||
call print_message
|
call print_message
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " "
|
10: .asciz " "
|
||||||
20: .asciz "kB free base memory after PXE unload\n"
|
20: .asciz "kB free base memory after PXE unload\n"
|
||||||
.previous
|
.previous
|
||||||
@@ -503,7 +501,7 @@ print_pxe_error:
|
|||||||
call print_message
|
call print_message
|
||||||
popw %si
|
popw %si
|
||||||
ret
|
ret
|
||||||
.section ".prefix.data"
|
.section ".prefix.data", "aw", @progbits
|
||||||
10: .asciz " UNDI API call "
|
10: .asciz " UNDI API call "
|
||||||
20: .asciz " failed: status code "
|
20: .asciz " failed: status code "
|
||||||
30: .asciz "\n"
|
30: .asciz "\n"
|
||||||
|
|||||||
@@ -19,9 +19,6 @@
|
|||||||
#define SIZEOF_I386_ALL_REGS ( SIZEOF_REAL_MODE_REGS + SIZEOF_I386_FLAGS )
|
#define SIZEOF_I386_ALL_REGS ( SIZEOF_REAL_MODE_REGS + SIZEOF_I386_FLAGS )
|
||||||
|
|
||||||
.arch i386
|
.arch i386
|
||||||
.section ".text16", "ax", @progbits
|
|
||||||
.section ".text16.data", "aw", @progbits
|
|
||||||
.section ".data16", "aw", @progbits
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Global descriptor table
|
* Global descriptor table
|
||||||
@@ -47,7 +44,7 @@
|
|||||||
#else
|
#else
|
||||||
#define RM_LIMIT_16_19__AVL__SIZE__GRANULARITY 0x00
|
#define RM_LIMIT_16_19__AVL__SIZE__GRANULARITY 0x00
|
||||||
#endif
|
#endif
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
.align 16
|
.align 16
|
||||||
gdt:
|
gdt:
|
||||||
gdtr: /* The first GDT entry is unused, the GDTR can fit here. */
|
gdtr: /* The first GDT entry is unused, the GDTR can fit here. */
|
||||||
@@ -99,7 +96,7 @@ gdt_end:
|
|||||||
* %edi : Physical base of protected-mode code (virt_offset)
|
* %edi : Physical base of protected-mode code (virt_offset)
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl init_librm
|
.globl init_librm
|
||||||
init_librm:
|
init_librm:
|
||||||
@@ -149,7 +146,7 @@ init_librm:
|
|||||||
popl %eax
|
popl %eax
|
||||||
lret
|
lret
|
||||||
|
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
.weak idt_init
|
.weak idt_init
|
||||||
set_seg_base:
|
set_seg_base:
|
||||||
@@ -177,7 +174,7 @@ idt_init: /* Reuse the return opcode here */
|
|||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
real_to_prot:
|
real_to_prot:
|
||||||
/* Make sure we have our data segment available */
|
/* Make sure we have our data segment available */
|
||||||
@@ -209,7 +206,7 @@ real_to_prot:
|
|||||||
orb $CR0_PE, %al
|
orb $CR0_PE, %al
|
||||||
movl %eax, %cr0
|
movl %eax, %cr0
|
||||||
data32 ljmp $VIRTUAL_CS, $1f
|
data32 ljmp $VIRTUAL_CS, $1f
|
||||||
.section ".text"
|
.section ".text", "ax", @progbits
|
||||||
.code32
|
.code32
|
||||||
1:
|
1:
|
||||||
/* Set up protected-mode data segments and stack pointer */
|
/* Set up protected-mode data segments and stack pointer */
|
||||||
@@ -240,7 +237,7 @@ real_to_prot:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
/* Default IDTR with no interrupts */
|
/* Default IDTR with no interrupts */
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
.weak idtr
|
.weak idtr
|
||||||
idtr:
|
idtr:
|
||||||
rm_idtr:
|
rm_idtr:
|
||||||
@@ -266,7 +263,7 @@ rm_idtr:
|
|||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text"
|
.section ".text", "ax", @progbits
|
||||||
.code32
|
.code32
|
||||||
prot_to_real:
|
prot_to_real:
|
||||||
/* Add return address to data to be moved to RM stack */
|
/* Add return address to data to be moved to RM stack */
|
||||||
@@ -296,7 +293,7 @@ prot_to_real:
|
|||||||
movw %ax, %gs
|
movw %ax, %gs
|
||||||
movw %ax, %ss
|
movw %ax, %ss
|
||||||
ljmp $REAL_CS, $1f
|
ljmp $REAL_CS, $1f
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
1:
|
1:
|
||||||
/* Switch to real mode */
|
/* Switch to real mode */
|
||||||
@@ -328,13 +325,13 @@ p2r_jump_target:
|
|||||||
* rather than .data16 because code needs to be able to locate
|
* rather than .data16 because code needs to be able to locate
|
||||||
* the data segment.
|
* the data segment.
|
||||||
*/
|
*/
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
p2r_jump_vector:
|
p2r_jump_vector:
|
||||||
.word p2r_jump_target
|
.word p2r_jump_target
|
||||||
.globl rm_cs
|
.globl rm_cs
|
||||||
rm_cs: .word 0
|
rm_cs: .word 0
|
||||||
.globl rm_ds
|
.globl rm_ds
|
||||||
.section ".text16.data"
|
.section ".text16.data", "aw", @progbits
|
||||||
rm_ds: .word 0
|
rm_ds: .word 0
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -378,7 +375,7 @@ rm_ds: .word 0
|
|||||||
#define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
|
#define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
|
||||||
#define PC_OFFSET_END ( PC_OFFSET_FUNCTION + 4 )
|
#define PC_OFFSET_END ( PC_OFFSET_FUNCTION + 4 )
|
||||||
|
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
.globl prot_call
|
.globl prot_call
|
||||||
prot_call:
|
prot_call:
|
||||||
@@ -403,7 +400,7 @@ prot_call:
|
|||||||
movl $PC_OFFSET_END, %ecx
|
movl $PC_OFFSET_END, %ecx
|
||||||
pushl $1f
|
pushl $1f
|
||||||
jmp real_to_prot
|
jmp real_to_prot
|
||||||
.section ".text"
|
.section ".text", "ax", @progbits
|
||||||
.code32
|
.code32
|
||||||
1:
|
1:
|
||||||
/* Set up environment expected by C code */
|
/* Set up environment expected by C code */
|
||||||
@@ -419,7 +416,7 @@ prot_call:
|
|||||||
movl $PC_OFFSET_END, %ecx
|
movl $PC_OFFSET_END, %ecx
|
||||||
pushl $1f
|
pushl $1f
|
||||||
jmp prot_to_real
|
jmp prot_to_real
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
1:
|
1:
|
||||||
/* Reload GDT and IDT, restore registers and flags and return */
|
/* Reload GDT and IDT, restore registers and flags and return */
|
||||||
@@ -475,7 +472,7 @@ prot_call:
|
|||||||
#define RC_OFFSET_FUNCTION ( RC_OFFSET_RETADDR + 4 )
|
#define RC_OFFSET_FUNCTION ( RC_OFFSET_RETADDR + 4 )
|
||||||
#define RC_OFFSET_END ( RC_OFFSET_FUNCTION + 4 )
|
#define RC_OFFSET_END ( RC_OFFSET_FUNCTION + 4 )
|
||||||
|
|
||||||
.section ".text"
|
.section ".text", "ax", @progbits
|
||||||
.code32
|
.code32
|
||||||
.globl real_call
|
.globl real_call
|
||||||
real_call:
|
real_call:
|
||||||
@@ -487,7 +484,7 @@ real_call:
|
|||||||
movl $( RC_OFFSET_RETADDR + 4 /* function pointer copy */ ), %ecx
|
movl $( RC_OFFSET_RETADDR + 4 /* function pointer copy */ ), %ecx
|
||||||
pushl $1f
|
pushl $1f
|
||||||
jmp prot_to_real
|
jmp prot_to_real
|
||||||
.section ".text16"
|
.section ".text16", "ax", @progbits
|
||||||
.code16
|
.code16
|
||||||
1:
|
1:
|
||||||
/* Call real-mode function */
|
/* Call real-mode function */
|
||||||
@@ -503,7 +500,7 @@ real_call:
|
|||||||
movl $RC_OFFSET_RETADDR, %ecx
|
movl $RC_OFFSET_RETADDR, %ecx
|
||||||
pushl $1f
|
pushl $1f
|
||||||
jmp real_to_prot
|
jmp real_to_prot
|
||||||
.section ".text"
|
.section ".text", "ax", @progbits
|
||||||
.code32
|
.code32
|
||||||
1:
|
1:
|
||||||
/* Restore registers and return */
|
/* Restore registers and return */
|
||||||
@@ -514,7 +511,7 @@ real_call:
|
|||||||
/* Function vector, used because "call xx(%sp)" is not a valid
|
/* Function vector, used because "call xx(%sp)" is not a valid
|
||||||
* 16-bit expression.
|
* 16-bit expression.
|
||||||
*/
|
*/
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
rc_function: .word 0, 0
|
rc_function: .word 0, 0
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -551,7 +548,7 @@ rc_function: .word 0, 0
|
|||||||
* to us.
|
* to us.
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".data"
|
.section ".data", "aw", @progbits
|
||||||
.globl rm_sp
|
.globl rm_sp
|
||||||
rm_sp: .word 0
|
rm_sp: .word 0
|
||||||
.globl rm_ss
|
.globl rm_ss
|
||||||
@@ -567,13 +564,13 @@ pm_esp: .long _estack
|
|||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
/* Internal copies, created by init_librm (which runs in real mode) */
|
/* Internal copies, created by init_librm (which runs in real mode) */
|
||||||
.section ".data16"
|
.section ".data16", "aw", @progbits
|
||||||
_virt_offset: .long 0
|
_virt_offset: .long 0
|
||||||
_text16: .long 0
|
_text16: .long 0
|
||||||
_data16: .long 0
|
_data16: .long 0
|
||||||
|
|
||||||
/* Externally-visible copies, created by real_to_prot */
|
/* Externally-visible copies, created by real_to_prot */
|
||||||
.section ".data"
|
.section ".data", "aw", @progbits
|
||||||
.globl virt_offset
|
.globl virt_offset
|
||||||
virt_offset: .long 0
|
virt_offset: .long 0
|
||||||
.globl text16
|
.globl text16
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.section ".data", "aw"
|
.section ".data", "aw", @progbits
|
||||||
.balign 4
|
.balign 4
|
||||||
.globl _embedded_image_start
|
.globl _embedded_image_start
|
||||||
_embedded_image_start:
|
_embedded_image_start:
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
.arch i386
|
.arch i386
|
||||||
|
|
||||||
.section ".data"
|
.section ".data", "aw", @progbits
|
||||||
watch_me:
|
watch_me:
|
||||||
.long 0xfeedbeef
|
.long 0xfeedbeef
|
||||||
|
|
||||||
.section ".text"
|
.section ".text", "ax", @progbits
|
||||||
.code32
|
.code32
|
||||||
gdbstub_test:
|
gdbstub_test:
|
||||||
/* 1. Read registers test */
|
/* 1. Read registers test */
|
||||||
|
|||||||
Reference in New Issue
Block a user