|
;; $Id: cmdline.inc,v 1.1 2007-09-01 22:44:04 niro Exp $ |
|
1 |
;; ----------------------------------------------------------------------- |
;; ----------------------------------------------------------------------- |
2 |
;; |
;; |
3 |
;; Copyright 2003 H. Peter Anvin - All Rights Reserved |
;; Copyright 2003-2009 H. Peter Anvin - All Rights Reserved |
4 |
|
;; Copyright 2009 Intel Corporation; author: H. Peter Anvin |
5 |
;; |
;; |
6 |
;; This program is free software; you can redistribute it and/or modify |
;; This program is free software; you can redistribute it and/or modify |
7 |
;; it under the terms of the GNU General Public License as published by |
;; it under the terms of the GNU General Public License as published by |
21 |
|
|
22 |
; |
; |
23 |
; Assumes DS == CS |
; Assumes DS == CS |
24 |
|
; |
25 |
make_plain_cmdline: |
make_plain_cmdline: |
26 |
push es |
push es |
27 |
; ui.inc has already copied any APPEND options |
; ui.inc has already copied any APPEND options |
28 |
mov ax,real_mode_seg |
mov ax,real_mode_seg |
29 |
mov es,ax |
mov es,ax |
30 |
|
|
|
mov si,[CmdOptPtr] |
|
31 |
mov di,[CmdLinePtr] |
mov di,[CmdLinePtr] |
32 |
|
call do_ip_append |
33 |
|
|
34 |
|
mov si,[CmdOptPtr] |
35 |
|
|
36 |
call strcpy |
call strcpy |
37 |
|
|
38 |
dec di |
dec di |
41 |
pop es |
pop es |
42 |
ret |
ret |
43 |
|
|
44 |
|
; |
45 |
|
; Actual IPAppend strings... |
46 |
|
; |
47 |
|
%if IS_PXELINUX |
48 |
|
section .data |
49 |
|
alignz 2 |
50 |
|
IPAppends dw IPOption |
51 |
|
dw BOOTIFStr |
52 |
|
numIPAppends equ ($-IPAppends)/2 |
53 |
|
%else |
54 |
|
IPAppends equ 0 |
55 |
|
numIPAppends equ 0 |
56 |
|
%endif |
57 |
|
|
58 |
|
; |
59 |
|
; Handle "ipappend" strings, if applicable |
60 |
|
; |
61 |
|
; Assumes DS == CS; pushes output to ES:DI |
62 |
|
; |
63 |
|
section .text |
64 |
|
|
65 |
|
do_ip_append: |
66 |
|
%ifndef DEPEND |
67 |
|
%if numIPAppends > 0 |
68 |
|
push cx |
69 |
|
push bx |
70 |
|
push si |
71 |
|
|
72 |
|
mov bx,IPAppends |
73 |
|
mov cx,[IPAppend] |
74 |
|
and cx,(1 << numIPAppends)-1 |
75 |
|
.loop: |
76 |
|
jcxz .done |
77 |
|
mov si,[bx] |
78 |
|
inc bx |
79 |
|
inc bx |
80 |
|
test cl,1 |
81 |
|
jz .not_this |
82 |
|
|
83 |
|
call strcpy |
84 |
|
mov byte [es:di-1],' ' ; Replace final null with space |
85 |
|
.not_this: |
86 |
|
shr cx,1 |
87 |
|
jmp .loop |
88 |
|
.done: |
89 |
|
pop si |
90 |
|
pop bx |
91 |
|
pop cx |
92 |
|
%endif |
93 |
|
%endif |
94 |
|
ret |