Remove last users of getcbuf; reclaim the address space
authorH. Peter Anvin <hpa@zytor.com>
Tue, 12 Feb 2008 08:32:24 +0000 (00:32 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 12 Feb 2008 08:32:24 +0000 (00:32 -0800)
Remove the last few uses of getcbuf (to extend trackbuf for shuffle
descriptors, and for temp storage during pxelinux config file search.)
As a result, change the way RBFG_brainfuck is handled in pxelinux (at
some point it's probably not worth maintaining anymore, as RBFG is no
longer widely used); add a .bss2 section for the region between the
RBFG zone and the stack.

comboot.inc
extlinux.asm
isolinux.asm
layout.inc
ldlinux.asm
pxelinux.asm

index 9d9ca24..3a9b433 100644 (file)
@@ -604,7 +604,7 @@ comapi_dnsresolv equ comapi_err
 ; INT 22h AX=0011h     Maximum number of shuffle descriptors
 ;
 comapi_maxshuffle:
-               mov P_CX,(2*trackbufsize)/12
+               mov P_CX,trackbufsize/12
                ret
 
 ;
index 9459f56..aa78589 100644 (file)
@@ -109,8 +109,7 @@ file_mode   resw 1
                section .earlybss
 trackbufsize   equ 8192
 trackbuf       resb trackbufsize       ; Track buffer goes here
-getcbuf                resb trackbufsize
-               ; ends at 4800h
+               ; ends at 2800h
 
                section .bss1
 SuperBlock     resb 1024               ; ext2 superblock
index e0c41ea..e485532 100644 (file)
@@ -102,8 +102,7 @@ dir_clust   resd 1                  ; Length in clusters
                section .earlybss
 trackbufsize   equ 8192
 trackbuf       resb trackbufsize       ; Track buffer goes here
-getcbuf                resb trackbufsize
-;              ends at 4800h
+;              ends at 2800h
 
                ; Some of these are touched before the whole image
                ; is loaded.  DO NOT move this to .uibss.
index 4ee7874..ba6b231 100644 (file)
@@ -52,6 +52,23 @@ STACK_START  equ TEXT_START-STACK_SIZE
                ; but are in order to offload .bss
                section .bss1           nobits valign=16 vfollows=.config.end
 
+               ; Warning here: RBFG build 22 randomly overwrites
+               ; memory location [0x5680,0x576c), possibly more.  It
+               ; seems that it gets confused and screws up the
+               ; pointer to its own internal packet buffer and starts
+               ; writing a received ARP packet into low memory.
+%if IS_PXELINUX
+               section .rbfg           nobits start=0x5680
+RBFG_brainfuck:        resb 2048               ; Bigger than an Ethernet packet...
+%endif
+
+               ; For section following .rbfg
+%if IS_PXELINUX
+               section .bss2           nobits valign=16 vfollows=.rbfg
+%else
+               section .bss2           nobits valign=16 vfollows=.bss1
+%endif
+
                section .text           start=TEXT_START
                ; NASM BUG: .data always follows .text; can't override
                section .data           align=16 ; follows=.text
index 468e2b8..217fb15 100644 (file)
@@ -108,8 +108,7 @@ file_left   resd 1                  ; Number of sectors left
                section .earlybss
 trackbufsize   equ 8192
 trackbuf       resb trackbufsize       ; Track buffer goes here
-getcbuf                resb trackbufsize
-               ; ends at 4800h
+               ; ends at 2800h
 
                section .bss
                alignb 8
index 02f38c0..f9e911c 100644 (file)
@@ -186,12 +186,7 @@ tftp_pktbuf        resw 1                  ; Packet buffer offset
                section .earlybss
 trackbufsize   equ 8192
 trackbuf       resb trackbufsize       ; Track buffer goes here
-getcbuf                resb trackbufsize
-               ; ends at 4800h
-
-               ; Put some large buffers here, before RBFG_brainfuck,
-               ; where we can still carefully control the address
-               ; assignments...
+               ; ends at 2800h
 
                alignb open_file_t_size
 Files          resb MAX_OPEN*open_file_t_size
@@ -204,12 +199,6 @@ IPOption   resb 80                 ; ip= option buffer
 InitStack      resd 1                  ; Pointer to reset stack (SS:SP)
 PXEStack       resd 1                  ; Saved stack during PXE call
 
-; Warning here: RBFG build 22 randomly overwrites memory location
-; [0x5680,0x576c), possibly more.  It seems that it gets confused and
-; screws up the pointer to its own internal packet buffer and starts
-; writing a received ARP packet into low memory.
-RBFG_brainfuck resb 0E00h
-
                section .bss
                alignb 4
 RebootTime     resd 1                  ; Reboot timeout, if set by option
@@ -818,7 +807,7 @@ config_scan:
                call writestr
                call crlf
                mov si,di
-               mov di,getcbuf
+               mov di,KernelName       ;  Borrow this buffer for mangled name
                call mangle_name
                call open
                popa