Odd code in boot/sys.c

Odd code in boot/sys.c

Post by Paul Newhou » Thu, 30 May 1996 04:00:00

I found the following code in boot/sys.c (-current).  Which goes a long way in explaining
why I can't boot from my third IDE disk (Secondary Master):

                if (*cp >= '0' && *cp <= '9')
                        if ((unit = *cp++ - '0') > 1) {
                                printf("Bad unit\n");
                                return 1;

I'm at a loss as to why the code checks for the character pointed at by cp to
be within the range 0-9, inclusive, and then after decoding it decides to limit
the range to 0 or 1??  

You don't get "Bad unit", if you specify 'x' instead of 0-9.

Is there a problem with using 2 or 3 in the boot line:  "wd(2,a)/netbsd"
I was pretty sure I had this working on a previous version of NetBSD (maybe it was
FreeBSD or BSDI???).

I thought I'd ask before changing the "> 1" to "> 9".  Just incase there is some
really bad thing that can happen.  Suggestions, comments, actual knowledge
are appreciated.

All views, opinions and statements are my own.  They are not necessarily
those of any employer, client or associate. If you want their opinion
you should ask them  *8^)


1. Code fragments/plug-ins for solaris?

Is there anyway to write code fragments or plug-ins easily for Unix and/or

Essentially, I want to do what something like Photoshop does on my Mac (and
what I can do as code resources on my Mac).

A program looks in a directory for its plug-ins.  It plug-in contains a
fragment of code with a defined entry-point and constant interface.  The
plug-in however, is not fully linked or executable.

I want to be able to jump from the main program into the plug-ins according
to when their execution should be appropriate.

The shared object libraries come close... but I don't want the restriction
of having to link the main program with the plug-ins.

There is problably some deep kernel magic involved here, and or icky assembly

If you know how I can do this, would you please mind sending me an email
describing how to do this (or better yet, source code!)?



2. Sound Blaster Live (Value)

3. comp.sys.mac.misc comp.sys.mac.system comp.sys.mac.apps

4. interrupt file upload

5. comp.sys.hp comp.sys.sgi comp.sys.sun comp.unix.ultrix comp.unix.wizards

6. Linus Interview.

7. Booting Linux from Sys V/386 Boot Loader

8. multiline ssh command

9. Difference between Installing from Ins Svr and Boot Svr?

10. Odd code in sd_init()

11. i810-tco : odd behavior, odd driver ?

12. Need addresses for Source Code Licences (BSD4.3 and Sys V)

13. Bar Coding Apps for Sys V/386