LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 11-20-2008, 11:37 PM   #1
galapogos
Member
 
Registered: May 2008
Posts: 227

Rep: Reputation: 30
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.
 
Old 11-21-2008, 02:36 AM   #2
slack12ware
Member
 
Registered: Mar 2008
Location: Deep in the Jango(Africa)
Distribution: Slackware 12, Fedora 8
Posts: 46

Rep: Reputation: 15
did anybody solve this ?

Last edited by slack12ware; 11-21-2008 at 02:38 AM.
 
Old 11-21-2008, 03:38 AM   #3
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
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.
 
Old 11-21-2008, 03:50 AM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 11-21-2008, 04:12 AM   #5
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
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.
 
Old 11-21-2008, 04:34 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
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.
 
Old 11-21-2008, 05:55 AM   #7
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 11-21-2008, 06:27 AM   #8
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
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?
 
Old 11-21-2008, 07:05 AM   #9
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
Strings are usually NULL terminated. I'd try to put a NULL in the first position.
 
Old 11-23-2008, 11:26 PM   #10
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
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.
 
Old 11-24-2008, 02:44 AM   #11
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 11-24-2008, 04:34 AM   #12
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 11-24-2008, 04:59 AM   #13
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
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
 
Old 11-24-2008, 05:31 AM   #14
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by galapogos View Post
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'.
 
Old 11-24-2008, 05:36 AM   #15
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting OS to be default on Boot Loader choice menu tomdun2 Linux - General 9 08-09-2006 10:18 PM
can't use graphical menu in boot loader hacchan Mandriva 2 06-03-2005 11:17 PM
Grub boot loader menu shows two linux boot options pramos Linux - Newbie 3 09-13-2004 12:40 AM
boot loader menu... sspiro Linux - Newbie 2 06-05-2002 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration