* Interrupt Descriptor Table
****************************************************************************
*/
- .section ".data16"
+ .section ".data16", "aw", @progbits
.globl idtr
idtr:
idt_limit:
* Destroys %ax, %bx, and %di.
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
.globl idt_init
idt_init:
* Interrupt handlers
****************************************************************************
*/
- .section ".text"
+ .section ".text", "ax", @progbits
.code32
/* POSIX signal numbers for reporting traps to GDB */
.text
.arch i386
- .section ".text16", "ax", @progbits
- .section ".data16", "aw", @progbits
.code16
- .section ".text16"
+ .section ".text16", "ax", @progbits
.globl undiisr
undiisr:
popw %ds
iret
- .section ".data16"
+ .section ".data16", "aw", @progbits
undinet_params:
status: .word 0
funcflag: .word 0
.text
.arch i386
- .section ".text16", "ax", @progbits
- .section ".data16", "aw", @progbits
- .section ".text16.data", "aw", @progbits
.code16
#define SMAP 0x534d4150
*
****************************************************************************
*/
- .section ".data16"
+ .section ".data16", "aw", @progbits
.align 16
.globl hidemem_base
.globl hidemem_umalloc
* %ecx:%ebx Length of windowed region
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
window_region:
/* Convert (start,len) to (start, end) */
addl %eax, %ebx
* %ax Modified memory above 1M in 1kB blocks
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
patch_1m:
pushal
/* Convert to (start,len) format and call truncate */
* %bx Modified memory above 16M in 64kB blocks
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
patch_16m:
pushal
/* Convert to (start,len) format and call truncate */
* %bx Modified memory above 16MB, in 64kB blocks
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
patch_1m_16m:
call patch_1m
call patch_16m
*
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
get_underlying_e820:
/* If the requested region is in the cache, return it */
jmp get_underlying_e820
.size get_underlying_e820, . - get_underlying_e820
- .section ".data16"
+ .section ".data16", "aw", @progbits
underlying_e820_index:
.word 0xffff /* Initialise to an invalid value */
.size underlying_e820_index, . - underlying_e820_index
- .section ".bss16"
+ .section ".bss16", "aw", @nobits
underlying_e820_ebx:
.long 0
.size underlying_e820_ebx, . - underlying_e820_ebx
- .section ".bss16"
+ .section ".bss16", "aw", @nobits
underlying_e820_cache:
.space E820MAXSIZE
.size underlying_e820_cache, . - underlying_e820_cache
- .section ".bss16"
+ .section ".bss16", "aw", @nobits
underlying_e820_cache_size:
.long 0
.size underlying_e820_cache_size, . - underlying_e820_cache_size
*
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
get_windowed_e820:
/* Preserve registers */
*
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
get_nonempty_e820:
/* Record entry parameters */
*
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
get_mangled_e820:
/* Get a nonempty region */
* INT 15,e820 handler
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
int15_e820:
pushw %ds
pushw %cs:rm_ds
* INT 15,e801 handler
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
int15_e801:
/* Call previous handler */
pushfw
* INT 15,88 handler
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
int15_88:
/* Call previous handler */
pushfw
* INT 15 handler
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.globl int15
int15:
/* See if we want to intercept this call */
ljmp *%cs:int15_vector
.size int15, . - int15
- .section ".text16.data"
+ .section ".text16.data", "aw", @progbits
.globl int15_vector
int15_vector:
.long 0
*/
.arch i386
- .section ".text16", "awx", @progbits
- .section ".text16.data", "aw", @progbits
- .section ".data16", "aw", @progbits
/****************************************************************************
* !PXE structure
****************************************************************************
*/
- .section ".text16.data"
+ .section ".text16.data", "aw", @progbits
.globl ppxe
.align 16
ppxe:
.size ppxe, . - ppxe
/* Define undiheader=0 as a weak symbol for non-ROM builds */
- .section ".weak"
+ .section ".weak", "a", @nobits
.weak undiheader
undiheader:
* PXENV+ structure
****************************************************************************
*/
- .section ".text16.data"
+ .section ".text16.data", "aw", @progbits
.globl pxenv
.align 16
pxenv:
* somebody at Wyse has difficulty distinguishing between the
* words "may" and "must"...
*/
- .section ".text16.null"
+ .section ".text16.null", "ax", @progbits
.code16
pxenv_null_entry:
jmp pxenv_entry
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
pxenv_entry:
pushl $pxe_api_call
* none
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
pxe_entry:
pxe_entry_sp:
* none
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
.globl pxe_int_1a
pxe_int_1a:
popfw
ljmp *%cs:pxe_int_1a_vector
- .section ".text16.data"
+ .section ".text16.data", "aw", @progbits
.globl pxe_int_1a_vector
pxe_int_1a_vector: .long 0
*/
.arch i386
- .section ".prefix.lib", "awx", @progbits
- .section ".data16", "aw", @progbits
/**
* High memory temporary load address
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl print_character
print_character:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl print_message
print_message:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl print_hex_dword
print_hex_dword:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl print_pci_busdevfn
print_pci_busdevfn:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl print_kill_line
print_kill_line:
#ifndef KEEP_IT_REAL
/* GDT for protected-mode calls */
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.align 16
pm_call_vars:
gdt:
.equ gdt_length, . - gdt
.size gdt, . - gdt
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.align 16
pm_saved_gdt:
.long 0, 0
.equ pm_call_vars_size, . - 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
pm_call:
/* Preserve registers, flags, and RM return point */
* None
****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
copy_bytes:
pushl %ecx
* none
****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
install_block:
* none
****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl alloc_basemem
alloc_basemem:
* none
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
.globl free_basemem
free_basemem:
ret
.size free_basemem, . - free_basemem
- .section ".text16.data"
+ .section ".text16.data", "aw", @progbits
.globl hooked_bios_interrupts
hooked_bios_interrupts:
.word 0
* none
****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl install
install:
* none
****************************************************************************
*/
- .section ".prefix.lib"
+ .section ".prefix.lib", "awx", @progbits
.code16
.globl install_prealloc
install_prealloc:
.size install_prealloc, . - install_prealloc
/* Vectors for far calls to .text16 functions */
- .section ".data16"
+ .section ".data16", "aw", @progbits
#ifdef KEEP_IT_REAL
init_libkir_vector:
.word init_libkir
* none
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
.globl uninstall
uninstall:
.text
.arch i386
- .section ".prefix", "ax", @progbits
- .section ".prefix.data", "aw", @progbits
.code16
- .section ".prefix"
+ .section ".prefix", "ax", @progbits
.org 0
nbi_header:
.text
.arch i386
.org 0
- .section ".prefix", "ax", @progbits
- .section ".prefix.data", "aw", @progbits
.code16
#include <undi.h>
* Entry point: set operating context, print welcome message
*****************************************************************************
*/
- .section ".prefix"
+ .section ".prefix", "ax", @progbits
/* Set up our non-stack segment registers */
jmp $0x7c0, $1f
1: movw %cs, %ax
movw $10f, %si
xorw %di, %di
call print_message
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz "PXE->EB:"
.previous
movb $',', %al
call print_character
jmp 99f
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " PXENV+ at "
.previous
movb $',', %al
call print_character
jmp 99f
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " !PXE at "
.previous
movw $10f, %si
call print_message
jmp finished
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " No PXE stack found!\n"
.previous
99:
call print_message
les entry_segoff, %bx
call print_segoff
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " entry point at "
.previous
/* Print UNDI code segment */
call print_message
les undi_code_segoff, %bx
call print_segoff
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz "\n UNDI code segment "
.previous
/* Print UNDI data segment */
call print_message
les undi_data_segoff, %bx
call print_segoff
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz ", data segment "
.previous
/* Print UNDI memory usage */
call print_word
movw $20f, %si
call print_message
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " ("
20: .asciz "kB)\n"
.previous
movb $0x0a, %al
call print_character
jmp 99f
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " UNDI device is PCI "
.previous
/* No device found, or device type not understood */
movw $10f, %si
call print_message
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " Unable to determine UNDI physical device\n"
.previous
call print_word
movw $20f, %si
call print_message
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " "
20: .asciz "kB free base memory after PXE unload\n"
.previous
call print_message
popw %si
ret
- .section ".prefix.data"
+ .section ".prefix.data", "aw", @progbits
10: .asciz " UNDI API call "
20: .asciz " failed: status code "
30: .asciz "\n"
#define SIZEOF_I386_ALL_REGS ( SIZEOF_REAL_MODE_REGS + SIZEOF_I386_FLAGS )
.arch i386
- .section ".text16", "ax", @progbits
- .section ".text16.data", "aw", @progbits
- .section ".data16", "aw", @progbits
/****************************************************************************
* Global descriptor table
#else
#define RM_LIMIT_16_19__AVL__SIZE__GRANULARITY 0x00
#endif
- .section ".data16"
+ .section ".data16", "aw", @progbits
.align 16
gdt:
gdtr: /* The first GDT entry is unused, the GDTR can fit here. */
* %edi : Physical base of protected-mode code (virt_offset)
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
.globl init_librm
init_librm:
popl %eax
lret
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
.weak idt_init
set_seg_base:
*
****************************************************************************
*/
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
real_to_prot:
/* Make sure we have our data segment available */
orb $CR0_PE, %al
movl %eax, %cr0
data32 ljmp $VIRTUAL_CS, $1f
- .section ".text"
+ .section ".text", "ax", @progbits
.code32
1:
/* Set up protected-mode data segments and stack pointer */
ret
/* Default IDTR with no interrupts */
- .section ".data16"
+ .section ".data16", "aw", @progbits
.weak idtr
idtr:
rm_idtr:
*
****************************************************************************
*/
- .section ".text"
+ .section ".text", "ax", @progbits
.code32
prot_to_real:
/* Add return address to data to be moved to RM stack */
movw %ax, %gs
movw %ax, %ss
ljmp $REAL_CS, $1f
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
1:
/* Switch to real mode */
* rather than .data16 because code needs to be able to locate
* the data segment.
*/
- .section ".data16"
+ .section ".data16", "aw", @progbits
p2r_jump_vector:
.word p2r_jump_target
.globl rm_cs
rm_cs: .word 0
.globl rm_ds
- .section ".text16.data"
+ .section ".text16.data", "aw", @progbits
rm_ds: .word 0
/****************************************************************************
#define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
#define PC_OFFSET_END ( PC_OFFSET_FUNCTION + 4 )
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
.globl prot_call
prot_call:
movl $PC_OFFSET_END, %ecx
pushl $1f
jmp real_to_prot
- .section ".text"
+ .section ".text", "ax", @progbits
.code32
1:
/* Set up environment expected by C code */
movl $PC_OFFSET_END, %ecx
pushl $1f
jmp prot_to_real
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
1:
/* Reload GDT and IDT, restore registers and flags and return */
#define RC_OFFSET_FUNCTION ( RC_OFFSET_RETADDR + 4 )
#define RC_OFFSET_END ( RC_OFFSET_FUNCTION + 4 )
- .section ".text"
+ .section ".text", "ax", @progbits
.code32
.globl real_call
real_call:
movl $( RC_OFFSET_RETADDR + 4 /* function pointer copy */ ), %ecx
pushl $1f
jmp prot_to_real
- .section ".text16"
+ .section ".text16", "ax", @progbits
.code16
1:
/* Call real-mode function */
movl $RC_OFFSET_RETADDR, %ecx
pushl $1f
jmp real_to_prot
- .section ".text"
+ .section ".text", "ax", @progbits
.code32
1:
/* Restore registers and return */
/* Function vector, used because "call xx(%sp)" is not a valid
* 16-bit expression.
*/
- .section ".data16"
+ .section ".data16", "aw", @progbits
rc_function: .word 0, 0
/****************************************************************************
* to us.
****************************************************************************
*/
- .section ".data"
+ .section ".data", "aw", @progbits
.globl rm_sp
rm_sp: .word 0
.globl rm_ss
****************************************************************************
*/
/* Internal copies, created by init_librm (which runs in real mode) */
- .section ".data16"
+ .section ".data16", "aw", @progbits
_virt_offset: .long 0
_text16: .long 0
_data16: .long 0
/* Externally-visible copies, created by real_to_prot */
- .section ".data"
+ .section ".data", "aw", @progbits
.globl virt_offset
virt_offset: .long 0
.globl text16
- .section ".data", "aw"
+ .section ".data", "aw", @progbits
.balign 4
.globl _embedded_image_start
_embedded_image_start:
.arch i386
- .section ".data"
+ .section ".data", "aw", @progbits
watch_me:
.long 0xfeedbeef
- .section ".text"
+ .section ".text", "ax", @progbits
.code32
gdbstub_test:
/* 1. Read registers test */