Re: Device Driver
H. Peter Anvin <[EMAIL PROTECTED]> wrote: > Ok, yes now I get it. Yes, this is stupid. > Anyone here have any experience with SmartMedia and if they are sane or > stupid? I wrote the SmartMedia FlashPath driver, and I can say that the SmartMedia is fine, but the FlashPath is a little silly. (And I sometimes feel very bad for what I was forced to write due to NDA and time constraints).. (See my post on C++ kernel modules) (and evil sys_mount() syscall overloading...) (and evil /dev/fd0 driver overloading...) (basically this driver is an example of what NOT to allow in a mainline kernel... but had to be written that way to comply with marketing...) http://www.smartdisk.com/Downloads/Software/flashpath-0.2.1.tar.gz -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: [Criticism] On the discussion about C++ modules
Eray Ozkural <[EMAIL PROTECTED]> wrote: > I've read a summary of a discussion about C++ module writing on > this list, and I'd like to make some comments on it. [I'm not > subscribed to this list, please retain a Cc: to my address] I've had the (dubious) opportunity to write a C++ kernel module for Linux 2.2.x earlier this year for a client. (Code is at: http://www.smartdisk.com/Downloads/Software/flashpath-0.2.1.tar.gz ) Anyway, here's my two cents: * If you have to port a C++ codebase to run in linux, rewrite it in C. * If you can't rewrite it in C (politics, size, time, etc) make a C++<->C API translation. * All kernel calls must go through the translation * Use the minimal C++ runtime in flashpath-0.2.1/linux/cppfake.c C++ is ugly as kernel code. I do _NOT_ recommend starting a new project with it. However, if you're porting alien C++ code, it can be done. And it's not pretty. ObWackyKernelLanguage: Objective C If people are interested, I can whip up an Objective C runtime for the kernel. Will be slow as molasses compared to C, but should make for interesting driver modularity (and flame wars)... -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: [Criticism] On the discussion about C++ modules
Eray Ozkural [EMAIL PROTECTED] wrote: I've read a summary of a discussion about C++ module writing on this list, and I'd like to make some comments on it. [I'm not subscribed to this list, please retain a Cc: to my address] I've had the (dubious) opportunity to write a C++ kernel module for Linux 2.2.x earlier this year for a client. (Code is at: http://www.smartdisk.com/Downloads/Software/flashpath-0.2.1.tar.gz ) Anyway, here's my two cents: * If you have to port a C++ codebase to run in linux, rewrite it in C. * If you can't rewrite it in C (politics, size, time, etc) make a C++-C API translation. * All kernel calls must go through the translation * Use the minimal C++ runtime in flashpath-0.2.1/linux/cppfake.c C++ is ugly as kernel code. I do _NOT_ recommend starting a new project with it. However, if you're porting alien C++ code, it can be done. And it's not pretty. ObWackyKernelLanguage: Objective C If people are interested, I can whip up an Objective C runtime for the kernel. Will be slow as molasses compared to C, but should make for interesting driver modularity (and flame wars)... -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Device Driver
H. Peter Anvin [EMAIL PROTECTED] wrote: Ok, yes now I get it. Yes, this is stupid. Anyone here have any experience with SmartMedia and if they are sane or stupid? I wrote the SmartMedia FlashPath driver, and I can say that the SmartMedia is fine, but the FlashPath is a little silly. (And I sometimes feel very bad for what I was forced to write due to NDA and time constraints).. (See my post on C++ kernel modules) (and evil sys_mount() syscall overloading...) (and evil /dev/fd0 driver overloading...) (basically this driver is an example of what NOT to allow in a mainline kernel... but had to be written that way to comply with marketing...) http://www.smartdisk.com/Downloads/Software/flashpath-0.2.1.tar.gz -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2.4.x] Yet Another Boot Logo
Gábor Lénárt <[EMAIL PROTECTED]> wrote: > IMHO, 2 lines are not enough. It should be costumizable setting. It'll be in the next patch. (in a day or so) > (If you're crazy enough :) you can use settings to set X,Y offset and > X,Y size of window for "text", and you can get illusion to boot in > a window of logo has border around the used window ;-) I don't think I'm crazy enough for that. ;-) > And a question: will memory used by Linux logo be freed after hiding it ? It's marked as __initdata, so yes, all of that memory is freed immediately before /bin/init is execed. -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: [patch] Make linux logo centered, add margins, etc. for 2.2.17
Torrey Hoffman <[EMAIL PROTECTED]> wrote: > This is a patch to linux-2.2.17. > > As you all probably know, the current framebuffer driver (fbcon.c) > displays an 80x80 pixel penguin logo at the top left of the screen. > > This patch modifies fbcon.c to display the linux logo centered > horizontally, with optional margins (LOGO_MARGIN) above and below. > The boot console displays in the remaining space. I've also developed a patch (posted just now to lkml), that does nearly the same thing for the 2.4.x series kernels. The major difference is that I use a PPM file (and have a conversion utility in linux/scripts/ called ppmtolinuxlogo.c), and mine can be configured out of the kernel from a Config.in. Please feel free to rip out the ppmtolinuxlogo.c and put it in your patch, if you would like. Also, you may want to look at the Makefile dependencies and Config.in/Configure.help changes to improve your patch. I also have a 2.2.x version of my patch, but I can forward you that in private email if you would like. Very little changed. -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: [patch] Make linux logo centered, add margins, etc. for 2.2.17
And here's my patch for 2.4.x: This kernel patch will allow you to have a full-screen boot logo in any FBcon supported video mode, except for VGA text mode. After applying the patch, you simply need to answer `Y' to `Custom boot logo' under the Framebuffer Support options. Then, place your custom boot_logo.ppm into linux/Documentation/boot_logo.ppm When you recompile your kernel, the boot_logo.ppm file will be reconstructed into a 214 color, 16 color, and 2 color B include file in linux/drivers/video/boot_logo.h When you boot into the logo-enabled kernel, the logo will be automatically centered on your framebuffer, and you will have 2 lines of kernel/init status at the bottom of your screen. Like the std. ``penguin'' logo, your custom logo will be repeated horizontally for however many processors your have on your system, or however many logos will fit - whichever is smaller. To remove the logo from the screen, simply switch away from, them back to, the original boot-up VT. Comments, suggestions, patches, etc. are welcome. diff --new-file -u -r linux-2.4.x/Documentation/Configure.help linux-2.4.x-logo/Documentation/Configure.help --- linux-2.4.x/Documentation/Configure.helpWed Aug 30 12:57:37 2000 +++ linux-2.4.x-logo/Documentation/Configure.help Sat Sep 23 20:12:50 2000 @@ -3052,6 +3052,21 @@ running kernel whenever you want), say M here and read Documentation/modules.txt. The module will be called vga16fb.o. +Customizable Boot Logo for graphics modes +CONFIG_FBCON_LOGO_BOOT + This allows you to change the boot logo from the default + `penguin' bootup. If you enable this option, make sure that + the PNM utilities and development headers/libraries are installed. + (aka libgr and libgr-devel). + + Place your custom logo as a PPM file in the Documentation directory: + + /usr/src/linux/Documentation/boot_logo.ppm + + When you recompile your kernel and fbcon is enabled in a graphics + mode (ie anything but VGA text), your logo will be centered and + there will be 2 lines for boot messages. + Select other compiled-in fonts CONFIG_FBCON_FONTS Say Y here if you would like to use fonts other than the default diff --new-file -u -r linux-2.4.x/drivers/video/Config.in linux-2.4.x-logo/drivers/video/Config.in --- linux-2.4.x/drivers/video/Config.in Mon Aug 14 09:04:25 2000 +++ linux-2.4.x-logo/drivers/video/Config.inSat Sep 23 19:44:52 2000 @@ -159,6 +159,7 @@ tristate ' Virtual Frame Buffer support (ONLY FOR TESTING!)' CONFIG_FB_VIRTUAL fi + bool ' Custom boot splash screen (graphics mode only)?' CONFIG_FBCON_LOGO_BOOT bool ' Advanced low level driver options' CONFIG_FBCON_ADVANCED if [ "$CONFIG_FBCON_ADVANCED" = "y" ]; then tristate 'Monochrome support' CONFIG_FBCON_MFB diff --new-file -u -r linux-2.4.x/drivers/video/Makefile linux-2.4.x-logo/drivers/video/Makefile --- linux-2.4.x/drivers/video/Makefile Mon Aug 14 09:04:25 2000 +++ linux-2.4.x-logo/drivers/video/Makefile Sat Sep 23 20:14:48 2000 @@ -160,7 +160,7 @@ include $(TOPDIR)/Rules.make clean: - rm -f core *.o *.a *.s + rm -f core *.o *.a *.s boot_logo.h ../conmakehash: ../conmakehash.c $(HOSTCC) $(HOSTCFLAGS) -o ../conmakehash ../conmakehash.c @@ -171,3 +171,14 @@ -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > promcon_tbl.c promcon_tbl.o: promcon_tbl.c $(TOPDIR)/include/linux/types.h + +ifeq ($(CONFIG_FBCON_LOGO_BOOT),y) +fbcon.o: boot_logo.h + +boot_logo.h: $(TOPDIR)/Documentation/boot_logo.ppm + $(MAKE) -C $(TOPDIR)/scripts ppmtolinuxlogo + ppmquant 214 $(TOPDIR)/Documentation/boot_logo.ppm | +$(TOPDIR)/scripts/ppmtolinuxlogo >boot_logo.h + ppmquant 16 $(TOPDIR)/Documentation/boot_logo.ppm | +$(TOPDIR)/scripts/ppmtolinuxlogo -16 >>boot_logo.h + ppmquant 2 $(TOPDIR)/Documentation/boot_logo.ppm | +$(TOPDIR)/scripts/ppmtolinuxlogo -bw >>boot_logo.h +endif + diff --new-file -u -r linux-2.4.x/drivers/video/fbcon.c linux-2.4.x-logo/drivers/video/fbcon.c --- linux-2.4.x/drivers/video/fbcon.c Mon Jul 24 21:24:26 2000 +++ linux-2.4.x-logo/drivers/video/fbcon.c Sat Sep 23 20:03:04 2000 @@ -94,9 +94,12 @@ #ifdef CONFIG_FBCON_VGA_PLANES #include #endif +#ifndef CONFIG_FBCON_LOGO_BOOT #define INCLUDE_LINUX_LOGO_DATA +#endif #include + #include #include/* for 6x11 font on mac */ #include @@ -107,8 +110,14 @@ # define DPRINTK(fmt, args...) #endif -#define LOGO_H 80 -#define LOGO_W 80 +#ifndef CONFIG_FBCON_LOGO_BOOT +#define LOGO_W 80 +#define LOGO_H 80 +#else +#define INCLUDE_LINUX_LOGO16 +#define INCLUDE_LINUX_LOGOBW +#include "boot_logo.h" +#endif #define LOGO_LINE (LOGO_W/8) struct display fb_display[MAX_NR_CONSOLES]; @@ -608,8 +617,12 @@ /* Need to make room for the logo */ int cnt; int step; - + +#ifdef CONFIG_FBCON_LOGO_BOOT + logo_lines = nr_rows -
Re: [patch] Make linux logo centered, add margins, etc. for 2.2.17
Torrey Hoffman [EMAIL PROTECTED] wrote: This is a patch to linux-2.2.17. As you all probably know, the current framebuffer driver (fbcon.c) displays an 80x80 pixel penguin logo at the top left of the screen. This patch modifies fbcon.c to display the linux logo centered horizontally, with optional margins (LOGO_MARGIN) above and below. The boot console displays in the remaining space. I've also developed a patch (posted just now to lkml), that does nearly the same thing for the 2.4.x series kernels. The major difference is that I use a PPM file (and have a conversion utility in linux/scripts/ called ppmtolinuxlogo.c), and mine can be configured out of the kernel from a Config.in. Please feel free to rip out the ppmtolinuxlogo.c and put it in your patch, if you would like. Also, you may want to look at the Makefile dependencies and Config.in/Configure.help changes to improve your patch. I also have a 2.2.x version of my patch, but I can forward you that in private email if you would like. Very little changed. -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: [patch] Make linux logo centered, add margins, etc. for 2.2.17
And here's my patch for 2.4.x: This kernel patch will allow you to have a full-screen boot logo in any FBcon supported video mode, except for VGA text mode. After applying the patch, you simply need to answer `Y' to `Custom boot logo' under the Framebuffer Support options. Then, place your custom boot_logo.ppm into linux/Documentation/boot_logo.ppm When you recompile your kernel, the boot_logo.ppm file will be reconstructed into a 214 color, 16 color, and 2 color BW include file in linux/drivers/video/boot_logo.h When you boot into the logo-enabled kernel, the logo will be automatically centered on your framebuffer, and you will have 2 lines of kernel/init status at the bottom of your screen. Like the std. ``penguin'' logo, your custom logo will be repeated horizontally for however many processors your have on your system, or however many logos will fit - whichever is smaller. To remove the logo from the screen, simply switch away from, them back to, the original boot-up VT. Comments, suggestions, patches, etc. are welcome. diff --new-file -u -r linux-2.4.x/Documentation/Configure.help linux-2.4.x-logo/Documentation/Configure.help --- linux-2.4.x/Documentation/Configure.helpWed Aug 30 12:57:37 2000 +++ linux-2.4.x-logo/Documentation/Configure.help Sat Sep 23 20:12:50 2000 @@ -3052,6 +3052,21 @@ running kernel whenever you want), say M here and read Documentation/modules.txt. The module will be called vga16fb.o. +Customizable Boot Logo for graphics modes +CONFIG_FBCON_LOGO_BOOT + This allows you to change the boot logo from the default + `penguin' bootup. If you enable this option, make sure that + the PNM utilities and development headers/libraries are installed. + (aka libgr and libgr-devel). + + Place your custom logo as a PPM file in the Documentation directory: + + /usr/src/linux/Documentation/boot_logo.ppm + + When you recompile your kernel and fbcon is enabled in a graphics + mode (ie anything but VGA text), your logo will be centered and + there will be 2 lines for boot messages. + Select other compiled-in fonts CONFIG_FBCON_FONTS Say Y here if you would like to use fonts other than the default diff --new-file -u -r linux-2.4.x/drivers/video/Config.in linux-2.4.x-logo/drivers/video/Config.in --- linux-2.4.x/drivers/video/Config.in Mon Aug 14 09:04:25 2000 +++ linux-2.4.x-logo/drivers/video/Config.inSat Sep 23 19:44:52 2000 @@ -159,6 +159,7 @@ tristate ' Virtual Frame Buffer support (ONLY FOR TESTING!)' CONFIG_FB_VIRTUAL fi + bool ' Custom boot splash screen (graphics mode only)?' CONFIG_FBCON_LOGO_BOOT bool ' Advanced low level driver options' CONFIG_FBCON_ADVANCED if [ "$CONFIG_FBCON_ADVANCED" = "y" ]; then tristate 'Monochrome support' CONFIG_FBCON_MFB diff --new-file -u -r linux-2.4.x/drivers/video/Makefile linux-2.4.x-logo/drivers/video/Makefile --- linux-2.4.x/drivers/video/Makefile Mon Aug 14 09:04:25 2000 +++ linux-2.4.x-logo/drivers/video/Makefile Sat Sep 23 20:14:48 2000 @@ -160,7 +160,7 @@ include $(TOPDIR)/Rules.make clean: - rm -f core *.o *.a *.s + rm -f core *.o *.a *.s boot_logo.h ../conmakehash: ../conmakehash.c $(HOSTCC) $(HOSTCFLAGS) -o ../conmakehash ../conmakehash.c @@ -171,3 +171,14 @@ -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' promcon_tbl.c promcon_tbl.o: promcon_tbl.c $(TOPDIR)/include/linux/types.h + +ifeq ($(CONFIG_FBCON_LOGO_BOOT),y) +fbcon.o: boot_logo.h + +boot_logo.h: $(TOPDIR)/Documentation/boot_logo.ppm + $(MAKE) -C $(TOPDIR)/scripts ppmtolinuxlogo + ppmquant 214 $(TOPDIR)/Documentation/boot_logo.ppm | +$(TOPDIR)/scripts/ppmtolinuxlogo boot_logo.h + ppmquant 16 $(TOPDIR)/Documentation/boot_logo.ppm | +$(TOPDIR)/scripts/ppmtolinuxlogo -16 boot_logo.h + ppmquant 2 $(TOPDIR)/Documentation/boot_logo.ppm | +$(TOPDIR)/scripts/ppmtolinuxlogo -bw boot_logo.h +endif + diff --new-file -u -r linux-2.4.x/drivers/video/fbcon.c linux-2.4.x-logo/drivers/video/fbcon.c --- linux-2.4.x/drivers/video/fbcon.c Mon Jul 24 21:24:26 2000 +++ linux-2.4.x-logo/drivers/video/fbcon.c Sat Sep 23 20:03:04 2000 @@ -94,9 +94,12 @@ #ifdef CONFIG_FBCON_VGA_PLANES #include asm/io.h #endif +#ifndef CONFIG_FBCON_LOGO_BOOT #define INCLUDE_LINUX_LOGO_DATA +#endif #include asm/linux_logo.h + #include video/fbcon.h #include video/fbcon-mac.h /* for 6x11 font on mac */ #include video/font.h @@ -107,8 +110,14 @@ # define DPRINTK(fmt, args...) #endif -#define LOGO_H 80 -#define LOGO_W 80 +#ifndef CONFIG_FBCON_LOGO_BOOT +#define LOGO_W 80 +#define LOGO_H 80 +#else +#define INCLUDE_LINUX_LOGO16 +#define INCLUDE_LINUX_LOGOBW +#include "boot_logo.h" +#endif #define LOGO_LINE (LOGO_W/8) struct display fb_display[MAX_NR_CONSOLES]; @@ -608,8 +617,12 @@ /* Need to make room for the logo */ int cnt; int step; - +
Re: [PATCH v2.4.x] Yet Another Boot Logo
Gábor Lénárt [EMAIL PROTECTED] wrote: IMHO, 2 lines are not enough. It should be costumizable setting. It'll be in the next patch. (in a day or so) (If you're crazy enough :) you can use settings to set X,Y offset and X,Y size of window for "text", and you can get illusion to boot in a window of logo has border around the used window ;-) I don't think I'm crazy enough for that. ;-) And a question: will memory used by Linux logo be freed after hiding it ? It's marked as __initdata, so yes, all of that memory is freed immediately before /bin/init is execed. -- Jason McMullan, Senior Linux Consultant, Linuxcare, Inc. 412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax [EMAIL PROTECTED], http://www.linuxcare.com/ Linuxcare. Support for the revolution. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/