apply to that specific program only; other changes apply to all of
them.
+Changes in 2.04:
+ * ALL: Reclaim even more low memory by observing that
+ comboot_seg == real_mode_seg is perfectly fine, and by the
+ fact that the 1000h segment managed to get unused in all
+ derivatives...
+
Changes in 2.03:
* Actually support comment lines in the configuration file.
* PXELINUX: Try to resolve some problems with stack switches.
;
; Now check that there is sufficient low (DOS) memory
;
+; NOTE: Linux doesn't use all of real_mode_seg, but we use the same
+; segment for COMBOOT images, which can use all 64K
+;
+dosram_k equ (real_mode_seg+0x1000) >> 6 ; Minimum DOS memory (K)
int 12h
- cmp ax,(real_mode_seg+0xa00) >> 6
+ cmp ax,dosram_k
jae enough_ram
mov si,err_noram
call writestr
; Segment assignments in the bottom 640K
; 0000h - main code/data segment (and BIOS segment)
;
-real_mode_seg equ 5000h
-vk_seg equ 4000h ; Virtual kernels
-xfer_buf_seg equ 3000h ; Bounce buffer for I/O to high mem
-comboot_seg equ 2000h ; COMBOOT image loading zone
+real_mode_seg equ 3000h
+vk_seg equ 2000h ; Virtual kernels
+xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
+comboot_seg equ real_mode_seg ; COMBOOT image loading zone
;
; File structure. This holds the information for each currently open file.
wipe_char db BS, ' ', BS, 0
err_notfound db 'Could not find kernel image: ',0
err_notkernel db CR, LF, 'Invalid or corrupt kernel image.', CR, LF, 0
-err_noram db 'It appears your computer has less than 360K of low ("DOS")'
- db 0Dh, 0Ah
+err_noram db 'It appears your computer has less than '
+ asciidec dosram_k
+ db 'K of low ("DOS")'
+ db CR, LF
db 'RAM. Linux needs at least this amount to boot. If you get'
- db 0Dh, 0Ah
+ db CR, LF
db 'this message in error, hold down the Ctrl key while'
- db 0Dh, 0Ah
- db 'booting, and I will take your word for it.', 0Dh, 0Ah, 0
+ db CR, LF
+ db 'booting, and I will take your word for it.', CR, LF, 0
err_badcfg db 'Unknown keyword in config file.', CR, LF, 0
err_noparm db 'Missing parameter in config file.', CR, LF, 0
err_noinitrd db CR, LF, 'Could not find ramdisk image: ', 0
;
; 0000h - main code/data segment (and BIOS segment)
;
-real_mode_seg equ 7000h
-fat_seg equ 5000h ; 128K area for FAT (2x64K)
-vk_seg equ 4000h ; Virtual kernels
-xfer_buf_seg equ 3000h ; Bounce buffer for I/O to high mem
-comboot_seg equ 2000h ; COMBOOT image loading zone
+real_mode_seg equ 5000h
+fat_seg equ 3000h ; 128K area for FAT (2x64K)
+vk_seg equ 2000h ; Virtual kernels
+xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
+comboot_seg equ real_mode_seg ; COMBOOT image loading zone
; ---------------------------------------------------------------------------
; BEGIN CODE
wipe_char db BS, ' ', BS, 0
err_notfound db 'Could not find kernel image: ',0
err_notkernel db CR, LF, 'Invalid or corrupt kernel image.', CR, LF, 0
-err_noram db 'It appears your computer has less than 488K of low ("DOS")'
+err_noram db 'It appears your computer has less than '
+ asciidec dosram_k
+ db 'K of low ("DOS")'
db CR, LF
db 'RAM. Linux needs at least this amount to boot. If you get'
db CR, LF
;; $Id$
;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2003 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;
; Macros similar to res[bwd], but which works in the code segment (after
-; section .text)
+; section .text) or the data segment (section .data)
;
-%macro zb 1
+%macro zb 1.nolist
times %1 db 0
%endmacro
-%macro zw 1
+%macro zw 1.nolist
times %1 dw 0
%endmacro
-%macro zd 1
+%macro zd 1.nolist
times %1 dd 0
%endmacro
;
+; Macro to emit an unsigned decimal number as a string
+;
+%macro asciidec 1.nolist
+%if %1 >= 1000000000
+ db ((%1/1000000000) % 10) + '0'
+%endif
+%if %1 >= 100000000
+ db ((%1/100000000) % 10) + '0'
+%endif
+%if %1 >= 10000000
+ db ((%1/10000000) % 10) + '0'
+%endif
+%if %1 >= 1000000
+ db ((%1/1000000) % 10) + '0'
+%endif
+%if %1 >= 100000
+ db ((%1/100000) % 10) + '0'
+%endif
+%if %1 >= 10000
+ db ((%1/10000) % 10) + '0'
+%endif
+%if %1 >= 1000
+ db ((%1/1000) % 10) + '0'
+%endif
+%if %1 >= 100
+ db ((%1/100) % 10) + '0'
+%endif
+%if %1 >= 10
+ db ((%1/10) % 10) + '0'
+%endif
+ db (%1 % 10) + '0'
+%endmacro
+
+;
; Macros for network byte order of constants
;
%define htons(x) ( ( ((x) & 0FFh) << 8 ) + ( ((x) & 0FF00h) >> 8 ) )
NULLFILE equ 0 ; Zero byte == null file name
REBOOT_TIME equ 5*60 ; If failure, time until full reset
%assign HIGHMEM_SLOP 128*1024 ; Avoid this much memory near the top
-MAX_SOCKETS_LG2 equ 6 ; log2(Max number of open sockets)
+MAX_SOCKETS_LG2 equ 5 ; log2(Max number of open sockets)
MAX_SOCKETS equ (1 << MAX_SOCKETS_LG2)
TFTP_PORT equ htons(69) ; Default TFTP port
PKT_RETRY equ 6 ; Packet transmit retry count
; Segment assignments in the bottom 640K
; 0000h - main code/data segment (and BIOS segment)
;
-real_mode_seg equ 5000h
-vk_seg equ 4000h ; Virtual kernels
-xfer_buf_seg equ 3000h ; Bounce buffer for I/O to high mem
-comboot_seg equ 2000h ; COMBOOT image loading zone
+real_mode_seg equ 4000h
+vk_seg equ 3000h ; Virtual kernels
+xfer_buf_seg equ 2000h ; Bounce buffer for I/O to high mem
+tftp_buf_seg equ 1000h ; Packet buffers segments
+comboot_seg equ real_mode_seg ; COMBOOT image loading zone
;
; BOOTP/DHCP packet pattern
tftp_remoteip resd 1 ; Remote IP address
tftp_filepos resd 1 ; Position within file
tftp_filesize resd 1 ; Total file size
+tftp_pktbuf resw 1 ; Packet buffer offset
+tftp_dataptr resw 1 ; Pointer to available data
+tftp_bytesleft resw 1 ; Unclaimed data bytes
+ resw 5 ; Currently unusued
endstruc
%ifndef DEPEND
wipe_char db BS, ' ', BS, 0
err_notfound db 'Could not find kernel image: ',0
err_notkernel db CR, LF, 'Invalid or corrupt kernel image.', CR, LF, 0
-err_noram db 'It appears your computer has less than 384K of low ("DOS")'
- db 0Dh, 0Ah
+err_noram db 'It appears your computer has less than '
+ asciidec dosram_k
+ db 'K of low ("DOS")'
+ db CR, LF
db 'RAM. Linux needs at least this amount to boot. If you get'
- db 0Dh, 0Ah
+ db CR, LF
db 'this message in error, hold down the Ctrl key while'
- db 0Dh, 0Ah
- db 'booting, and I will take your word for it.', 0Dh, 0Ah, 0
+ db CR, LF
+ db 'booting, and I will take your word for it.', CR, LF, 0
err_badcfg db 'Unknown keyword in config file.', CR, LF, 0
err_noparm db 'Missing parameter in config file.', CR, LF, 0
err_noinitrd db CR, LF, 'Could not find ramdisk image: ', 0