Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
11-20-2008, 11:37 PM
|
#1
|
Member
Registered: May 2008
Posts: 227
Rep:
|
Automatic boot loader(suppressed boot menu)
Hi,
I'm trying to create a disk image with a very small Linux environment running in it. The disk is a SATA drive(/dev/sda), and currently simply boots up either to a busybox shell, or directly runs a program after booting up. It has no init, and everything required is built into the kernel(no modules)
I was previously using nuni as it allows for a simple way of booting up without the boot menu coming up. However, I've found out that nuni doesn't seem to support SCSI/SATA drives, but only IDE drives up to 137GB. Only hda-hdk seem to be supported, so I can't use it.
I'm currently using LILO, and it works. However the LILO boot menu always comes up. Is there an easy way to suppress this menu and simply boot up to a default image?
Thanks.
*Edit* I've tried disabling "prompt" in lilo.conf, and this successfully gets rid of the boot menu. However, I'm still greeted with the message:
Code:
LILO 22.3.1 Loading image
BIOS data check successful
Is there anyway to suppress all these messages? I wish to hide the inner workings of the disk so it would be more professional to hide them.
Thanks!
Last edited by galapogos; 11-21-2008 at 12:06 AM.
|
|
|
11-21-2008, 02:36 AM
|
#2
|
Member
Registered: Mar 2008
Location: Deep in the Jango(Africa)
Distribution: Slackware 12, Fedora 8
Posts: 46
Rep:
|
did anybody solve this ?
Last edited by slack12ware; 11-21-2008 at 02:38 AM.
|
|
|
11-21-2008, 03:38 AM
|
#3
|
Member
Registered: May 2008
Posts: 227
Original Poster
Rep:
|
Still looking for an answer...the original solution you posted removing the prompt, timeout and default options got rid of the boot menu, but there are still those boot messages that I'm not sure how to get rid of.
|
|
|
11-21-2008, 03:50 AM
|
#4
|
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732
Rep:
|
What messages are you talking about and why do you want to remove them?
[edit] OK, I just checked your edit on the previous post. If you really want to get rid of *those* messages, hack the lilo source. Well, that should get rid of the "Lilo: Loading image" message anyway. I don't know if the BIOS check is done by Lilo or if it is called from the kernel's main().
Last edited by pinniped; 11-21-2008 at 03:52 AM.
|
|
|
11-21-2008, 04:12 AM
|
#5
|
Member
Registered: May 2008
Posts: 227
Original Poster
Rep:
|
Thanks pinniped.
I actually thought of editing the source as well, so I downloaded the latest source(22.8) and looked at it, however I could not find the message. Does anyone know which file it is in, or perhaps the message has changed from 22.3.1 to 22.8.
I guess I'll install 22.8, see if there are any new messages, then search for that in all the source files...unless someone has knowledge of this and can give me a heads up?
Thanks.
|
|
|
11-21-2008, 04:34 AM
|
#6
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638
Rep: 
|
Did you try GRUB? With only the default stanza in menu.lst and timeout=0 you shouldn't get a menu either. Maybe you can narrow the source(s) for the output from there.
|
|
|
11-21-2008, 05:55 AM
|
#7
|
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732
Rep:
|
The Lilo program itself installs a bootloader; I haven't dug into the guts of lilo, but the bootloader section itself is not necessarily built into the lilo program. As an example, Grub has stage1, 1_5, and 2 - when you 'install' grub, the program makes alterations to the stage1 file and writes the modified file contents to the boot record (whether MBR or partition boot record).
Hmm ... I just had a look at my bootsector and the only text I recognize is 'LILO' in the DOS system name section, so Stage1 of the lilo bootloader does not have such stuff in it. Browsing through the /boot directory I see the 'map' file - it's the only file I see which could be an actual bootloader (the files named boot* just don't look anything like a bootloader when inspected with 'khexedit') and it has all those strings you're interested in. I might be missing something - not 100% sure that 'map' is a bootloader - it may simply be data. It's hard to say because I don't have any disassembler to just convert the binary code to readable mnemonics and bootloaders don't have to conform to any particular specifications like ELF. At any rate, you need to find out where/how the 'map' file is created.
|
|
|
11-21-2008, 06:27 AM
|
#8
|
Member
Registered: May 2008
Posts: 227
Original Poster
Rep:
|
Thanks pinniped, I didn't think of looking at those files. Assuming the strings are in there, how would I modify them so that nothing is displayed during bootup? Could I simply hexedit those files and delete or put ASCII spaces where the strings appear?
|
|
|
11-21-2008, 07:05 AM
|
#9
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638
Rep: 
|
Strings are usually NULL terminated. I'd try to put a NULL in the first position.
|
|
|
11-23-2008, 11:26 PM
|
#10
|
Member
Registered: May 2008
Posts: 227
Original Poster
Rep:
|
Thanks. The null termination works for the "Loading image, BIOS data check successful" part. I just had to replace 'L', 'B' and 's' with 0x00 to get rid of the message. However the image name still appears. I tried using a space as the image name in LILO but it didn't accept a space as a name, so I'm currently using '.' Is there any other better way of getting rid of this as well?
Also, the "LILO 22.3.1" message still appears. There are a few occurrences of "LILO" but the PC would display some random repeating bytes when I tried modifying them.
|
|
|
11-24-2008, 02:44 AM
|
#11
|
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732
Rep:
|
Hehehe - I thought I'd download the source and have a look - being the bootloader it's mostly assembly. :}
You want to edit the file 'bootsect.S' - make a backup though so you can restore it if you really foul thing up.
Delete (on mine) lines 226-234; that's
Code:
mov ah,#0x03 ! read cursor pos
...
int 0x10
That gets rid of 'Loading'.
Then 353-357 (well, shifted if you already deleted 226-234):
Code:
pusha
mov ax, #0xe2e ! loading... message 2e = .
mov bx, #7
int 0x10
popa
*NOTE* There are 2 'pusha' instructions; only delete one of them (or else you have a major screwup).
And that gets rid of those dots . . . .
Let me know if the Linux version string still comes up.
|
|
|
11-24-2008, 04:34 AM
|
#12
|
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732
Rep:
|
OK, to remove the 'LILO ' part you need to edit first.S and second.S - remember to make backups first!
fgrep "al,#0x4c" *.S - find the "L"s
fgrep "al,#0x4F" *.S - find the "I"
fgrep "#ospc
In one case you see this sort of pattern:
Code:
mov al,#0x4c ; display an 'L'
call display
And in another you see:
Code:
dokay: mov bx,#ospc ; display 'O '
call say
*note* Do *NOT* remove the label 'dokay:' - just the rest of that line and the 'call say' below.
And there you go - 'LILO ' is now gone.
Now to figure out where that Lilo version number is ...
[edit] Oh yeah, *don't* nuke the word "LILO" or the version number in the map file or anything - it is used as a check mechanism.
Last edited by pinniped; 11-24-2008 at 04:39 AM.
|
|
|
11-24-2008, 04:59 AM
|
#13
|
Member
Registered: May 2008
Posts: 227
Original Poster
Rep:
|
Thanks pinniped, you've been of great help so far in this thread and my other one, I really appreciate it
It seems that in disk.S, there's a line
Code:
#define DELL_DIRTY_HACK
And if you look at the CHANGES document, it's described as follows under "Boot Loader":
Code:
DELL_DIRTY_HACK enables video with int 10h, fn=12h, subfn=36h
Since this enables video with int 10h, I wonder if it's possible to just undefine DELL_DIRTY_HACK(comment it out) instead of editing bootsect.S?
Also in first.S and second.S there's a portion called "Some messages" where those pesky messages("loading image, bios check success, etc) seem to be defined. Is it possible to just define those unwanted messages as ""?
btw the 2nd fgrep should be 0x49 not 0x4F. 0x4F is 'O', and it doesn't seem to exist in first.S or second.S.
I found out first hand what happened when I nuked the LILO in the map file 
|
|
|
11-24-2008, 05:31 AM
|
#14
|
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732
Rep:
|
Quote:
Originally Posted by galapogos
Since this enables video with int 10h, I wonder if it's possible to just undefine DELL_DIRTY_HACK(comment it out) instead of editing bootsect.S?
|
Unfortunately, no, that's a DELL_DIRTY_HACK after all - it just calls int10 with a different function/subfunction argument if you enable the hack. You can always redefine 'say' and 'display' to do nothing (except perhaps pop arguments if needed to prevent stack corruption). In fact, if you won't be using the interactive features at all, there is an awful lot you can cut out. The only thing to keep in mind is that you need to be careful that you don't whack the serial port output options (unless you don't care for that either).
Quote:
Originally Posted by galapogos
Also in first.S and second.S there's a portion called "Some messages" where those pesky messages("loading image, bios check success, etc) seem to be defined. Is it possible to just define those unwanted messages as ""?
|
Try it - what harm can it do? You can always revert to your backup.  Oh, while testing all this - have you got a LiveCD to rescue the system? I'm not sure if you can set up a dummy test system using BOCHS.
Quote:
Originally Posted by galapogos
btw the 2nd fgrep should be 0x49 not 0x4F. 0x4F is 'O', and it doesn't seem to exist in first.S or second.S.
|
Oops - stoopid me - getting crosseyed reading 'man ascii'.
|
|
|
11-24-2008, 05:36 AM
|
#15
|
Member
Registered: May 2008
Posts: 227
Original Poster
Rep:
|
I do have Knoppix as well as Mandriva LiveCD, however I won't be testing lilo on the dev PC. I hope to compile it on the dev PC and then copy/test it on the test platform, as I said in the other thread, because my test platform only has a very limited linux kernel/environment, with many things disabled. The shell is just a busybox. I don't even know if it has gcc 
|
|
|
All times are GMT -5. The time now is 12:59 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|