From 4cc0c3ab6541753b89cba58c345c0cae8c7d151d Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 13 May 2009 22:46:25 -0700 Subject: core: rename .text, .data and .bss to .text16, .data16, .bss16 Rename the .text, .data and .bss sections to .text16, .data16 and .bss16, in anticipation of being linked with compiler-generated 32-bit code, which presumably would like to use the standard section names. Signed-off-by: H. Peter Anvin --- core/abort.inc | 6 +++--- core/adv.inc | 6 +++--- core/bcopy32.inc | 2 +- core/bcopyxx.inc | 2 +- core/bootsect.inc | 2 +- core/cache.inc | 4 ++-- core/cleanup.inc | 2 +- core/cmdline.inc | 4 ++-- core/com32.inc | 6 +++--- core/comboot.inc | 14 +++++++------- core/configinit.inc | 4 ++-- core/conio.inc | 8 ++++---- core/cpuinit.inc | 4 ++-- core/diskstart.inc | 2 +- core/dnsresolv.inc | 8 ++++---- core/extlinux.asm | 12 ++++++------ core/font.inc | 6 +++--- core/getc.inc | 6 +++--- core/graphics.inc | 6 +++--- core/highmem.inc | 4 ++-- core/init.inc | 8 ++++---- core/isolinux.asm | 8 ++++---- core/layout.inc | 12 ++++++------ core/ldlinux.asm | 20 ++++++++++---------- core/loadhigh.inc | 8 ++++---- core/localboot.inc | 6 +++--- core/macros.inc | 2 +- core/parsecmd.inc | 4 ++-- core/parseconfig.inc | 6 +++--- core/plaincon.inc | 2 +- core/pm.inc | 22 +++++++++++----------- core/pxeidle.inc | 8 ++++---- core/pxelinux.asm | 50 +++++++++++++++++++++++++------------------------- core/rllpack.inc | 2 +- core/runkernel.inc | 4 ++-- core/strcpy.inc | 2 +- core/strecpy.inc | 2 +- core/syslinux.ld | 38 ++++++++++++++++++-------------------- core/ui.inc | 10 +++++----- core/writedec.inc | 2 +- 40 files changed, 161 insertions(+), 163 deletions(-) diff --git a/core/abort.inc b/core/abort.inc index d8cd7f24..d8a18883 100644 --- a/core/abort.inc +++ b/core/abort.inc @@ -17,7 +17,7 @@ ; Code to terminate a kernel load ; - section .text + section .text16 ; ; dot_pause: same as abort_check, except prints a dot, too @@ -77,7 +77,7 @@ error_or_command: jnz on_error jmp enter_command - section .data + section .data16 aborted_msg db ' aborted.', CR, LF, 0 - section .text + section .text16 diff --git a/core/adv.inc b/core/adv.inc index d856a1a2..c1a2628e 100644 --- a/core/adv.inc +++ b/core/adv.inc @@ -57,7 +57,7 @@ adv1: .data resb ADV_LEN .tail resd 1 .end equ $ - section .text + section .text16 ; ; This is called after config file parsing, so we know @@ -492,12 +492,12 @@ adv_read_write: stc jmp .cb_done - section .data + section .data16 alignz 4 ADVSec0 dd 0 ; Not specified ADVSec1 dd 0 ; Not specified ADVDrive db -1 ; No ADV defined ADVCHSInfo db -1 ; We have CHS info for this drive - section .bss + section .bss16 ADVOp resb 1 diff --git a/core/bcopy32.inc b/core/bcopy32.inc index 9e785f1f..b5f0ad31 100644 --- a/core/bcopy32.inc +++ b/core/bcopy32.inc @@ -29,7 +29,7 @@ ; bits 16 - section .text + section .text16 ; ; bcopy: diff --git a/core/bcopyxx.inc b/core/bcopyxx.inc index 4d322fc7..9239b554 100644 --- a/core/bcopyxx.inc +++ b/core/bcopyxx.inc @@ -318,4 +318,4 @@ bcopyxx_safe equ bcopyxx_len + bcopyxx_stack + 15 DummyTSS equ 0x580 bits 16 - section .text + section .text16 diff --git a/core/bootsect.inc b/core/bootsect.inc index f951bbc5..c976db69 100644 --- a/core/bootsect.inc +++ b/core/bootsect.inc @@ -211,4 +211,4 @@ replace_stub: jmp 0:0 .csip equ $-4 - section .text + section .text16 diff --git a/core/cache.inc b/core/cache.inc index 59755576..3b24cf04 100644 --- a/core/cache.inc +++ b/core/cache.inc @@ -10,7 +10,7 @@ ; ; ----------------------------------------------------------------------- - section .text + section .text16 struc cptr .sector: resd 1 ; Sector number @@ -103,7 +103,7 @@ getcachesector: pop cx ret - section .bss + section .bss16 ; Each CachePtr contains: ; - Block pointer diff --git a/core/cleanup.inc b/core/cleanup.inc index 1b00e0b0..9166f011 100644 --- a/core/cleanup.inc +++ b/core/cleanup.inc @@ -16,7 +16,7 @@ ;; Some final tidying before jumping to a kernel or bootsector ;; - section .text + section .text16 ; ; cleanup_hardware: ; diff --git a/core/cmdline.inc b/core/cmdline.inc index 642e5e14..8b84f48d 100644 --- a/core/cmdline.inc +++ b/core/cmdline.inc @@ -45,7 +45,7 @@ make_plain_cmdline: ; Actual IPAppend strings... ; %if IS_PXELINUX - section .data + section .data16 alignz 2 IPAppends dw IPOption dw BOOTIFStr @@ -60,7 +60,7 @@ numIPAppends equ 0 ; ; Assumes DS == CS; pushes output to ES:DI ; - section .text + section .text16 do_ip_append: %ifndef DEPEND diff --git a/core/com32.inc b/core/com32.inc index 5dc19ad0..3570a6d8 100644 --- a/core/com32.inc +++ b/core/com32.inc @@ -29,7 +29,7 @@ pm_entry equ 101000h - section .text + section .text16 is_com32_image: push si ; Save file handle push eax ; Save file length @@ -257,9 +257,9 @@ __com32_cfarcall: bits 16 - section .bss + section .bss16 alignb 4 RealModeEAX resd 1 ; Real mode EAX Com32SysSP resw 1 ; SP saved during COM32 syscall - section .text + section .text16 diff --git a/core/comboot.inc b/core/comboot.inc index 1c4695ba..7d9efba2 100644 --- a/core/comboot.inc +++ b/core/comboot.inc @@ -17,7 +17,7 @@ ;; Common code for running a COMBOOT image ;; - section .text + section .text16 ; Parameter registers definition; this is the definition ; of the stack frame used by INT 21h and INT 22h. @@ -178,11 +178,11 @@ comboot_setup_api: loop .loop2 ret - section .bss + section .bss16 alignb 4 DOSSaveVectors resd 32 - section .data + section .data16 %define comboot_err(x) (DOSErrTramp+4*((x)-20h)) comboot_vectors: @@ -219,7 +219,7 @@ comboot_vectors: dw comboot_err(3Eh) ; INT 3E = DOS FPU emulation dw comboot_err(3Fh) ; INT 3F = DOS overlay manager - section .text + section .text16 ; INT 21h: generic DOS system call comboot_int21: cli @@ -705,7 +705,7 @@ comapi_dnsresolv: comapi_dnsresolv equ comapi_err %endif - section .text + section .text16 ; ; INT 22h AX=0011h Obsolete @@ -988,7 +988,7 @@ comapi_shufraw: mov ecx,P_ECX jmp shuffle_and_boot_raw - section .data + section .data16 %macro int21 2 db %1 @@ -1067,7 +1067,7 @@ feature_flags_len equ ($-feature_flags) err_notdos db ': attempted DOS system call INT ',0 err_comlarge db 'COMBOOT image too large.', CR, LF, 0 - section .bss + section .bss16 alignb 4 DOSErrTramp resd 33 ; Error trampolines ConfigName resb FILENAME_MAX diff --git a/core/configinit.inc b/core/configinit.inc index cf6a814c..1dd253ce 100644 --- a/core/configinit.inc +++ b/core/configinit.inc @@ -16,7 +16,7 @@ ;; Initialize the configuration section ;; - section .text + section .text16 reset_config: call highmemsize @@ -54,6 +54,6 @@ mkkeymap: stosb ret - section .data + section .data16 linuxauto_cmd db 'linux auto',0 linuxauto_len equ $-linuxauto_cmd diff --git a/core/conio.inc b/core/conio.inc index fdb4b9f0..3e606619 100644 --- a/core/conio.inc +++ b/core/conio.inc @@ -23,7 +23,7 @@ ; loadkeys: Load a LILO-style keymap; file is open on the top of the ; getc stack. ; - section .text + section .text16 loadkeys: mov cx,256 @@ -363,7 +363,7 @@ debug_tracer: pushad ret %endif ; DEBUG_TRACERS - section .data + section .data16 %if IS_ISOLINUX == 0 ; Defined elsewhere for ISOLINUX crlf_msg db CR, LF null_msg db 0 @@ -376,7 +376,7 @@ DisplayCon dw 01h ; Console display enabled ScrollAttribute db 07h ; Grey on white (normal text color) - section .bss + section .bss16 alignb 2 NextCharJump resw 1 ; Routine to interpret next print char CursorDX equ $ @@ -396,4 +396,4 @@ FlowIgnore resb 1 ; Ignore input unless these bits set TextAttribute resb 1 ; Text attribute for message file DisplayMask resb 1 ; Display modes mask - section .text + section .text16 diff --git a/core/cpuinit.inc b/core/cpuinit.inc index 2b6460a8..85490ef0 100644 --- a/core/cpuinit.inc +++ b/core/cpuinit.inc @@ -40,7 +40,7 @@ enough_ram: skip_checks: call pm_init - section .data + section .data16 err_noram db 'It appears your computer has less than ' asciidec dosram_k db 'K of low ("DOS")' @@ -50,4 +50,4 @@ err_noram db 'It appears your computer has less than ' db 'this message in error, hold down the Ctrl key while' db CR, LF db 'booting, and I will take your word for it.', CR, LF, 0 - section .text + section .text16 diff --git a/core/diskstart.inc b/core/diskstart.inc index 68961244..0749dd84 100644 --- a/core/diskstart.inc +++ b/core/diskstart.inc @@ -652,7 +652,7 @@ rl_checkpt_off equ ($-$$) ; End of code and data that have to be in the first sector ; ---------------------------------------------------------------------------- - section .text + section .text16 all_read: ; ; Let the user (and programmer!) know we got this far. This used to be diff --git a/core/dnsresolv.inc b/core/dnsresolv.inc index e9bebad9..7b632378 100644 --- a/core/dnsresolv.inc +++ b/core/dnsresolv.inc @@ -24,7 +24,7 @@ DNS_MAX_PACKET equ 512 ; Defined by protocol DNS_LOCAL_PORT equ htons(60053) ; All local DNS queries come from this port # DNS_MAX_SERVERS equ 4 ; Max no of DNS servers - section .text + section .text16 ; ; Turn a string in DS:SI into a DNS "label set" in ES:DI. @@ -150,14 +150,14 @@ dns_skiplabel: .rdata: equ $ endstruc - section .bss + section .bss16 alignb 2 DNSSendBuf resb DNS_MAX_PACKET DNSRecvBuf resb DNS_MAX_PACKET LocalDomain resb 256 ; Max possible length DNSServers resd DNS_MAX_SERVERS - section .data + section .data16 pxe_udp_write_pkt_dns: .status: dw 0 ; Status .sip: dd 0 ; Server IP @@ -185,7 +185,7 @@ LastDNSServer dw DNSServers ; ; No segment assumptions permitted. ; - section .text + section .text16 dns_resolv: push ds push es diff --git a/core/extlinux.asm b/core/extlinux.asm index 39b98136..2529ab09 100644 --- a/core/extlinux.asm +++ b/core/extlinux.asm @@ -102,7 +102,7 @@ trackbufsize equ 8192 trackbuf resb trackbufsize ; Track buffer goes here ; ends at 2800h - section .bss + section .bss16 SuperBlock resb 1024 ; ext2 superblock ClustSize resd 1 ; Bytes/cluster ("block") ClustMask resd 1 ; Sectors/cluster - 1 @@ -355,11 +355,11 @@ open_inode: pop di ret - section .bss + section .bss16 alignb 4 ThisInode resb EXT2_GOOD_OLD_INODE_SIZE ; The most recently opened inode - section .text + section .text16 ; ; close_file: ; Deallocates a file structure (pointer in SI) @@ -587,7 +587,7 @@ searchdir: jmp .symlink_finish - section .bss + section .bss16 alignb 4 SymlinkBuf resb SYMLINK_SECTORS*SECTOR_SIZE+64 SymlinkTmpBuf equ trackbuf @@ -596,7 +596,7 @@ ThisDir resd 1 EndBlock resw 1 SymlinkCtr resb 1 - section .text + section .text16 ; ; mangle_name: Mangle a filename pointed to by DS:SI into a buffer pointed ; to by ES:DI; ends on encountering any whitespace. @@ -903,7 +903,7 @@ build_curdir_str: ; Begin data section ; ----------------------------------------------------------------------------- - section .data + section .data16 copyright_str db ' Copyright (C) 1994-' asciidec YEAR db ' H. Peter Anvin et al', CR, LF, 0 diff --git a/core/font.inc b/core/font.inc index 6c7aa781..12236358 100644 --- a/core/font.inc +++ b/core/font.inc @@ -16,7 +16,7 @@ ;; VGA font handling code ;; - section .text + section .text16 ; ; loadfont: Load a .psf font file and install it onto the VGA console @@ -141,12 +141,12 @@ vidrows_ok: mov [VidRows],al popa ret - section .data + section .data16 alignz 2 VGAFontSize dw 16 ; Defaults to 16 byte font UserFont db 0 ; Using a user-specified font - section .bss + section .bss16 alignb 4 GXPixCols resw 1 ; Graphics mode pixel columns GXPixRows resw 1 ; Graphics mode pixel rows diff --git a/core/getc.inc b/core/getc.inc index ca3a42a6..a8d54c7f 100644 --- a/core/getc.inc +++ b/core/getc.inc @@ -321,7 +321,7 @@ parseint: .isk: shl ebx,10 ; * 2^10 jmp .fini - section .bss + section .bss16 alignb 4 NumBuf resb 15 ; Buffer to load number NumBufEnd resb 1 ; Last byte in NumBuf @@ -329,14 +329,14 @@ NumBufEnd resb 1 ; Last byte in NumBuf GetCStack resb getc_file_size*MAX_GETC .end equ $ - section .data + section .data16 CurrentGetC dw GetCStack.end ; GetCStack empty ; ; unhexchar: Convert a hexadecimal digit in AL to the equivalent number; ; return CF=1 if not a hex digit ; - section .text + section .text16 unhexchar: cmp al,'0' jb .ret ; If failure, CF == 1 already diff --git a/core/graphics.inc b/core/graphics.inc index 78ae0a65..beb9985e 100644 --- a/core/graphics.inc +++ b/core/graphics.inc @@ -21,7 +21,7 @@ ; ; Assumes CS == DS == ES. ; - section .text + section .text16 vgadisplayfile: ; This is a cheap and easy way to make sure the screen is @@ -300,7 +300,7 @@ vgacursorcommon: ret - section .data + section .data16 ; Map colors to consecutive DAC registers linear_color db 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 @@ -308,7 +308,7 @@ linear_color db 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 ; of this byte. UsingVGA db 0 - section .bss + section .bss16 alignb 4 LSSHeader equ $ LSSMagic resd 1 ; Magic number diff --git a/core/highmem.inc b/core/highmem.inc index 5ae3abea..2a4c59e1 100644 --- a/core/highmem.inc +++ b/core/highmem.inc @@ -17,7 +17,7 @@ ;; mem= command on the command line while booting a new kernel. ;; - section .text + section .text16 ; ; This is set up as a subroutine; it will set up the global variable @@ -155,7 +155,7 @@ got_highmem: pop es ret ; Done! - section .bss + section .bss16 alignb 4 E820Buf resd 6 ; INT 15:E820 data buffer E820Mem resd 1 ; Memory detected by E820 diff --git a/core/init.inc b/core/init.inc index 827a5097..201d1b46 100644 --- a/core/init.inc +++ b/core/init.inc @@ -18,13 +18,13 @@ ; Common initialization code (inline) ; - section .text + section .text16 common_init: ; Zero bss sections (but not .earlybss, since it may ; contain already-live data.) xor eax,eax - mov di,__bss_start - mov cx,__bss_dwords + mov di,__bss16_start + mov cx,__bss16_dwords rep stosd mov di,__uibss_start mov cx,__uibss_dwords @@ -55,4 +55,4 @@ common_init: add ax,PKTBUF_SIZE loop .setbufptr %endif - section .text ; This is an inline file... + section .text16 ; This is an inline file... diff --git a/core/isolinux.asm b/core/isolinux.asm index 9183b352..4edee62c 100644 --- a/core/isolinux.asm +++ b/core/isolinux.asm @@ -101,7 +101,7 @@ trackbuf resb trackbufsize ; Track buffer goes here ; ends at 2800h ; Some of these are touched before the whole image - ; is loaded. DO NOT move this to .bss/.uibss. + ; is loaded. DO NOT move this to .bss16/.uibss. section .earlybss alignb 4 ISOFileName resb 64 ; ISO filename canonicalization buffer @@ -197,7 +197,7 @@ dsp_dummy: resb 1 ; Scratch, safe to overwrite _spec_end equ $ _spec_len equ _spec_end - _spec_start - section .bss + section .bss16 alignb open_file_t_size Files resb MAX_OPEN*open_file_t_size @@ -1079,7 +1079,7 @@ rl_checkpt equ $ ; Must be <= 800h ; End of code and data that have to be in the first sector ; ---------------------------------------------------------------------------- - section .text + section .text16 all_read: @@ -1722,7 +1722,7 @@ getfssec: ; Begin data section ; ----------------------------------------------------------------------------- - section .data + section .data16 default_str db 'default', 0 default_len equ ($-default_str) diff --git a/core/layout.inc b/core/layout.inc index 9a6fec57..535f2657 100644 --- a/core/layout.inc +++ b/core/layout.inc @@ -39,10 +39,10 @@ LATEBSS_START equ 0B800h section .config write progbits align=4 section .replacestub exec write progbits align=16 - ; Use .bss for things that doesn't have to be in low memory; + ; Use .bss16 for things that doesn't have to be in low memory; ; .earlybss should be used for things that absolutely have ; to be below 0x7c00. - section .bss write nobits align=16 + section .bss16 write nobits align=16 %if 0 ; IS_PXELINUX ; Warning here: RBFG build 22 randomly overwrites @@ -55,9 +55,9 @@ RBFG_brainfuck: resb 2048 ; Bigger than an Ethernet packet... %endif section .init exec write progbits align=1 - section .text exec write progbits align=1 + section .text16 exec write progbits align=1 section .bcopyxx exec write progbits align=16 - section .data write progbits align=16 + section .data16 write progbits align=16 section .adv write nobits align=512 @@ -72,14 +72,14 @@ RBFG_brainfuck: resb 2048 ; Bigger than an Ethernet packet... extern __%1_start, __%1_lma, __%1_end extern __%1_len, __%1_dwords %endmacro - SECINFO bss + SECINFO bss16 SECINFO uibss SECINFO config SECINFO replacestub global _start - section .text + section .text16 ; ; Segment assignments in the bottom 640K diff --git a/core/ldlinux.asm b/core/ldlinux.asm index a37437c2..6c5cac15 100644 --- a/core/ldlinux.asm +++ b/core/ldlinux.asm @@ -116,7 +116,7 @@ trackbufsize equ 8192 trackbuf resb trackbufsize ; Track buffer goes here ; ends at 2800h - section .bss + section .bss16 alignb 4 FAT resd 1 ; Location of (first) FAT RootDirArea resd 1 ; Location of root directory area @@ -568,7 +568,7 @@ search_dos_dir: pop bx ret - section .data + section .data16 alignz 4 ; Note: we have no use of the first 32 bytes (header), ; nor of the folloing 32 bytes (case mapping of control @@ -580,7 +580,7 @@ cp_unicode equ codepage+cp.unicode cp_unicode_alt equ codepage+cp.unicode_alt codepage_end equ $ - section .text + section .text16 ; ; Input: UCS-2 character in AX ; Output: Single byte character in AL, ZF = 1 @@ -602,12 +602,12 @@ ucs2_to_cp: not ax ; Doesn't change the flags! ret - section .bss + section .bss16 VFATInit resb 1 VFATNext resb 1 VFATCsum resb 1 - section .text + section .text16 ; ; close_file: ; Deallocates a file structure (pointer in SI) @@ -961,12 +961,12 @@ readdir: .end: ret - section .bss + section .bss16 alignb 4 CurrentDir resd 1 ; Current directory PrevDir resd 1 ; Last scanned directory - section .text + section .text16 ; ; @@ -1115,13 +1115,13 @@ mangle_dos_name: stosb ; Otherwise, write a space loop .period_loop ; Dec CX and *always* jump - section .bss + section .bss16 alignb 2 NameStart resw 1 NameLen resw 1 MangledBuf resb 11 - section .text + section .text16 ; ; getfssec_edx: Get multiple sectors from a file ; @@ -1398,7 +1398,7 @@ getfatsector: ; Begin data section ; ----------------------------------------------------------------------------- - section .data + section .data16 copyright_str db ' Copyright (C) 1994-' asciidec YEAR db ' H. Peter Anvin et al', CR, LF, 0 diff --git a/core/loadhigh.inc b/core/loadhigh.inc index 8ff9da1c..5c9969f6 100644 --- a/core/loadhigh.inc +++ b/core/loadhigh.inc @@ -17,7 +17,7 @@ ;; Load a file into high memory ;; - section .text + section .text16 ; ; load_high: loads (the remainder of) a file into high memory. @@ -103,12 +103,12 @@ load_high: .overflow: mov si,err_nohighmem jmp abort_load - section .data + section .data16 err_nohighmem db CR, LF db 'Not enough memory to load specified image.', CR, LF, 0 - section .bss + section .bss16 alignb 2 PauseBird resw 1 - section .text + section .text16 diff --git a/core/localboot.inc b/core/localboot.inc index ae54737a..3fee7d62 100644 --- a/core/localboot.inc +++ b/core/localboot.inc @@ -22,7 +22,7 @@ ; Boot a specified local disk. AX specifies the BIOS disk number; or ; -1 in case we should execute INT 18h ("next device.") ; - section .text + section .text16 local_boot: call vgaclearmode @@ -67,9 +67,9 @@ local_boot: int 18h ; Hope this does the right thing... jmp kaboom ; If we returned, oh boy... - section .data + section .data16 localboot_msg db 'Booting from local disk...', CR, LF, 0 - section .text + section .text16 %endif ; HAS_LOCALBOOT diff --git a/core/macros.inc b/core/macros.inc index 1aa2b2ce..e3aedca1 100644 --- a/core/macros.inc +++ b/core/macros.inc @@ -47,7 +47,7 @@ ; ; Macros similar to res[bwd], but which works in the code segment (after -; section .text) or the data segment (section .data) +; section .text16) or the data segment (section .data16) ; %macro zb 1.nolist times %1 db 0 diff --git a/core/parsecmd.inc b/core/parsecmd.inc index e63c205e..94627b8c 100644 --- a/core/parsecmd.inc +++ b/core/parsecmd.inc @@ -17,7 +17,7 @@ ;; Command line parser code ;; - section .text + section .text16 ; ------------------------------------------------------------------------- ; getcommand: Get a keyword from the current "getc" file and match it @@ -106,7 +106,7 @@ skipline: cmp al,10 ; Search for LF jnc skipline .end: ret - section .data + section .data16 err_badcfg db 'Unknown keyword in configuration file: ',0 err_noparm db 'Missing parameter in configuration file. Keyword: ',0 diff --git a/core/parseconfig.inc b/core/parseconfig.inc index fd1c6511..8dea6b3f 100644 --- a/core/parseconfig.inc +++ b/core/parseconfig.inc @@ -17,7 +17,7 @@ ;; Configuration file operations ;; - section .text + section .text16 ; ; "default" or "ui" command, with level (1 = default, 2 = ui) ; @@ -435,11 +435,11 @@ commit_vk: call writestr ret - section .data + section .data16 vk_overflow_msg db 'Out of memory parsing config file', CR, LF, 0 SerialNotice db 1 ; Only print this once - section .bss + section .bss16 alignb 4 VKernelEnd resd 1 ; Lowest high memory address used diff --git a/core/plaincon.inc b/core/plaincon.inc index 59b2cbb5..c41629d0 100644 --- a/core/plaincon.inc +++ b/core/plaincon.inc @@ -2,7 +2,7 @@ ; writechr: Write a single character in AL to the console without ; mangling any registers; handle video pages correctly. ; - section .text + section .text16 writechr: call write_serial ; write to serial port if needed diff --git a/core/pm.inc b/core/pm.inc index 8b02cf8e..5e5431cb 100644 --- a/core/pm.inc +++ b/core/pm.inc @@ -20,7 +20,7 @@ ;; PM refers to 32-bit flat protected mode; RM to 16-bit real mode. ;; - section .text + section .text16 ; ; pm_call: call PM routine in low memory from RM ; @@ -176,7 +176,7 @@ enter_rm: mov gs,dx jmp bx ; Go to whereever we need to go... - section .data + section .data16 alignz 4 ; If SS == 0, this will make any 32-bit users use @@ -186,7 +186,7 @@ PMESP dd StackTop ; Protected-mode ESP PM_IDT_ptr: dw 8*256-1 ; Length dd IDT ; Offset - section .bss + section .bss16 alignb 8 IDT: resq 256 IRQStubs: resb 4*256+3*8 @@ -202,7 +202,7 @@ RealModeSSSP resd 1 ; Real-mode SS:SP ; AL contains the register number. ; bits 32 - section .text + section .text16 pm_irq: pushad movzx esi,byte [esp+8*4] ; Interrupt number @@ -223,7 +223,7 @@ pm_irq: iretd bits 16 - section .text + section .text16 ; ; Routines to enable and disable (yuck) A20. These routines are gathered ; from tips from a couple of sources, including the Linux kernel and @@ -242,16 +242,16 @@ slow_out: out dx, al ; Fall through out IO_DELAY_PORT,al %endmacro - section .data + section .data16 alignz 2 A20Ptr dw a20_dunno - section .bss + section .bss16 alignb 4 A20Test resd 1 ; Counter for testing A20 status A20Tries resb 1 ; Times until giving up on A20 - section .text + section .text16 enable_a20: pushad mov byte [cs:A20Tries],255 ; Times to try to make this work @@ -350,9 +350,9 @@ a20_fast: mov si, err_a20 jmp abort_load - section .data + section .data16 err_a20 db CR, LF, 'A20 gate not responding!', CR, LF, 0 - section .text + section .text16 ; ; A20 unmasked, proceed... @@ -415,7 +415,7 @@ empty_8042: ; ; This initializes the protected-mode interrupt thunk set ; - section .text + section .text16 pm_init: xor edi,edi mov bx,IDT diff --git a/core/pxeidle.inc b/core/pxeidle.inc index 0e0e8b28..84a201f3 100644 --- a/core/pxeidle.inc +++ b/core/pxeidle.inc @@ -17,7 +17,7 @@ ;; Query for the NIC type, and detect certain special cases. ;; - section .text + section .text16 ;; ;; Initializes the idle mechanism based on the device type @@ -54,7 +54,7 @@ pxe_detect_nic_type: ;; ;; List of devices for which we want to actually issue idle calls. ;; - section .data + section .data16 alignz 4 pxe_idle_pci_list: ; @@ -75,7 +75,7 @@ pxe_idle_pci_list: ; .len equ ($-pxe_idle_pci_list) >> 2 - section .bss + section .bss16 pxenv_get_nic_type: .status: resw 1 .nic_type: resb 1 @@ -89,4 +89,4 @@ pxenv_get_nic_type: .svid: resw 1 .sdid: resw 1 - section .text + section .text16 diff --git a/core/pxelinux.asm b/core/pxelinux.asm index a8ce4e64..f50c2eb4 100644 --- a/core/pxelinux.asm +++ b/core/pxelinux.asm @@ -190,7 +190,7 @@ IPOption resb 80 ; ip= option buffer InitStack resd 1 ; Pointer to reset stack (SS:SP) PXEStack resd 1 ; Saved stack during PXE call - section .bss + section .bss16 alignb 4 RebootTime resd 1 ; Reboot timeout, if set by option StrucPtr resd 1 ; Pointer to PXENV+ or !PXE structure @@ -226,12 +226,12 @@ pxe_unload_stack_pkt_len equ $-pxe_unload_stack_pkt alignb 16 ; BOOTP/DHCP packet buffer - section .bss + section .bss16 alignb 16 packet_buf resb 2048 ; Transfer packet packet_buf_size equ $-packet_buf - section .text + section .text16 ; ; PXELINUX needs more BSS than the other derivatives; ; therefore we relocate it from 7C00h on startup. @@ -1479,12 +1479,12 @@ is_gpxe: pop es jmp .again - section .data + section .data16 gpxe_warning_msg: db 'URL syntax, but gPXE extensions not detected, ' db 'trying plain TFTP...', CR, LF, 0 HasGPXE db -1 ; Unknown - section .text + section .text16 %endif @@ -1648,11 +1648,11 @@ pxenv: ; Must be after function def due to NASM bug PXEEntry equ pxenv.jump+1 - section .bss + section .bss16 alignb 2 PXEStatus resb 2 - section .text + section .text16 ; ; getfssec: Get multiple clusters from a file, given the starting cluster. @@ -1896,14 +1896,14 @@ fill_buffer: ; ; This is roughly an exponential backoff... ; - section .data + section .data16 TimeoutTable: db 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 15, 18 db 21, 26, 31, 37, 44, 53, 64, 77, 92, 110, 132 db 159, 191, 229, 255, 255, 255, 255 TimeoutTableEnd equ $ - section .text + section .text16 ; ; ack_packet: ; @@ -2227,10 +2227,10 @@ pxe_get_cached_info: call crlf jmp kaboom - section .data + section .data16 get_packet_msg db 'Getting cached packet', 0 - section .text + section .text16 ; ; ip_ok ; @@ -2375,15 +2375,15 @@ parse_some_dhcp_options: .done: ret - section .data + section .data16 dhcp_option_list: - section .text + section .text16 %macro dopt 2 - section .data + section .data16 db %1 dw dopt_%2 - section .text + section .text16 dopt_%2: %endmacro @@ -2508,14 +2508,14 @@ dhcp_copyoption: stosb ; Null-terminate ret - section .data + section .data16 dhcp_option_list_end: - section .text + section .text16 - section .data + section .data16 HaveUUID db 0 uuid_dashes db 4,2,2,2,6,0 ; Bytes per UUID dashed section - section .text + section .text16 ; ; genipopt @@ -2633,7 +2633,7 @@ writestr_early equ writestr ; Begin data section ; ----------------------------------------------------------------------------- - section .data + section .data16 copyright_str db ' Copyright (C) 1994-' asciidec YEAR @@ -2677,7 +2677,7 @@ bootif_str_len equ $-bootif_str ; ; Extensions to search for (in *forward* order). -; (.bs and .bss are disabled for PXELINUX, since they are not supported) +; (.bs and .bss16 are disabled for PXELINUX, since they are not supported) ; alignz 4 exten_table: db '.cbt' ; COMBOOT (specific) @@ -2706,7 +2706,7 @@ old_api_unload: ; ; PXE query packets partially filled in ; - section .bss + section .bss16 pxe_bootp_query_pkt: .status: resw 1 ; Status .packettype: resw 1 ; Boot server packet type @@ -2741,7 +2741,7 @@ pxe_udp_read_pkt: %if GPXE - section .data + section .data16 gpxe_file_api_check: .status: dw 0 ; Status @@ -2751,7 +2751,7 @@ gpxe_file_api_check: .apimask: dd 0 .flags: dd 0 - section .bss + section .bss16 gpxe_file_open: .status: resw 1 ; Status @@ -2775,7 +2775,7 @@ gpxe_file_read: ; ; Misc initialized (data) variables ; - section .data + section .data16 alignz 4 BaseStack dd StackBuf ; ESP of base stack diff --git a/core/rllpack.inc b/core/rllpack.inc index 5304f61c..f871f0b9 100644 --- a/core/rllpack.inc +++ b/core/rllpack.inc @@ -27,7 +27,7 @@ ; High memory pointers point to one byte beyond the end. ; - section .text + section .text16 ; ; rllpack: diff --git a/core/runkernel.inc b/core/runkernel.inc index 8bfc8b8d..083c9672 100644 --- a/core/runkernel.inc +++ b/core/runkernel.inc @@ -629,7 +629,7 @@ writestr_qchk: jz writestr ret - section .data + section .data16 crlfloading_msg db CR, LF loading_msg db 'Loading ', 0 dotdot_msg db '.' @@ -662,7 +662,7 @@ str_initrd equ $+1 ; Pointer to "initrd=" in memory %endif db 0 - section .bss + section .bss16 alignb 4 MyHighMemSize resd 1 ; Possibly adjusted highmem size RamdiskMax resd 1 ; Highest address for ramdisk diff --git a/core/strcpy.inc b/core/strcpy.inc index 2bafa7fe..9762cbbf 100644 --- a/core/strcpy.inc +++ b/core/strcpy.inc @@ -2,7 +2,7 @@ ; strcpy: Copy DS:SI -> ES:DI up to and including a null byte; ; on exit SI and DI point to the byte *after* the null byte ; - section .text + section .text16 strcpy: push ax .loop: lodsb diff --git a/core/strecpy.inc b/core/strecpy.inc index 1fc53e96..bfcddc1a 100644 --- a/core/strecpy.inc +++ b/core/strecpy.inc @@ -5,7 +5,7 @@ ; target buffer; return with CF=1 if target buffer overflows; ; the output is still zero-terminated. ; - section .text + section .text16 strecpy: push ax diff --git a/core/syslinux.ld b/core/syslinux.ld index eb210882..a2a01552 100644 --- a/core/syslinux.ld +++ b/core/syslinux.ld @@ -36,15 +36,13 @@ SECTIONS __earlybss_dwords = (__earlybss_len + 3) >> 2; . = ALIGN(4); - .bss : { - __bss_start = .; - *(.bss) - *(.bss1) - *(.bss2) - __bss_end = .; + .bss16 : { + __bss16_start = .; + *(.bss16) + __bss16_end = .; } - __bss_len = __bss_end - __bss_start; - __bss_dwords = (__bss_len + 3) >> 2; + __bss16_len = __bss16_end - __bss16_start; + __bss16_dwords = (__bss16_len + 3) >> 2; . = ALIGN(4); .config : AT (__config_lma) { @@ -88,14 +86,14 @@ SECTIONS __init_len = __init_end - __init_start; __init_dwords = (__init_len + 3) >> 2; - .text : { + .text16 : { FILL(0x90909090) - __text_start = .; - *(.text) - __text_end = .; + __text16_start = .; + *(.text16) + __text16_end = .; } - __text_len = __text_end - __text_start; - __text_dwords = (__text_len + 3) >> 2; + __text16_len = __text16_end - __text16_start; + __text16_dwords = (__text16_len + 3) >> 2; . = ALIGN(16); .bcopyxx : { @@ -108,13 +106,13 @@ SECTIONS __bcopyxx_dwords = (__bcopyxx_len + 3) >> 2; . = ALIGN(4); - .data : { - __data_start = .; - *(.data) - __data_end = .; + .data16 : { + __data16_start = .; + *(.data16) + __data16_end = .; } - __data_len = __data_end - __data_start; - __data_dwords = (__data_len + 3) >> 2; + __data16_len = __data16_end - __data16_start; + __data16_dwords = (__data16_len + 3) >> 2; . = ALIGN(4); __config_lma = .; diff --git a/core/ui.inc b/core/ui.inc index c85383a6..b9d6e767 100644 --- a/core/ui.inc +++ b/core/ui.inc @@ -572,12 +572,12 @@ getchar_timeout: ; ; Anything else is assumed to be a Linux kernel. ; - section .bss + section .bss16 alignb 4 Kernel_EAX resd 1 Kernel_SI resw 1 - section .text + section .text16 kernel_good_saved: ; Alternate entry point for which the return from ; searchdir is stored in memory. This is used for @@ -683,7 +683,7 @@ is_bss_sector equ is_bad_image is_disk_image equ is_bad_image %endif - section .data + section .data16 boot_prompt db 'boot: ', 0 wipe_char db BS, ' ', BS, 0 err_badimage db 'Invalid image type for this media type!', CR, LF, 0 @@ -703,7 +703,7 @@ kerneltype_table: dw is_com32_image ; VK_COM32 dw is_config_file ; VK_CONFIG - section .bss + section .bss16 alignb 4 ThisKbdTo resd 1 ; Temporary holder for KbdTimeout ThisTotalTo resd 1 ; Temporary holder for TotalTimeout @@ -713,7 +713,7 @@ KbdFlags resb 1 ; Check for keyboard escapes FuncFlag resb 1 ; Escape sequences received from keyboard KernelType resb 1 ; Kernel type, from vkernel, if known - section .text + section .text16 ; ; Linux kernel loading code is common. ; diff --git a/core/writedec.inc b/core/writedec.inc index 10bf7bae..bfac0997 100644 --- a/core/writedec.inc +++ b/core/writedec.inc @@ -16,7 +16,7 @@ ;; Write decimal numbers to the console ;; - section .text + section .text16 ; ; writedec[bwl]: Write an unsigned decimal number in (AL, AX, EAX) ; to the console -- cgit v1.2.1