[syslinux:master] New

syslinux-bot for Marcel Ritter unrzl1 at linux.rrze.uni-erlangen.de
Mon Jul 5 14:27:21 PDT 2010


Commit-ID:  ef041926f4a55fc4d52bf7814791395435165cf9
Gitweb:     http://syslinux.zytor.com/commit/ef041926f4a55fc4d52bf7814791395435165cf9
Author:     Marcel Ritter <unrzl1 at linux.rrze.uni-erlangen.de>
AuthorDate: Tue, 20 Oct 2009 10:47:25 +0200
Committer:  Marcel Ritter <unrzl1 at linux.rrze.uni-erlangen.de>
CommitDate: Tue, 20 Oct 2009 10:47:25 +0200

New



---
 com32/lua/doc/syslinux.asc |  216 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 216 insertions(+), 0 deletions(-)

diff --git a/com32/lua/doc/syslinux.asc b/com32/lua/doc/syslinux.asc
new file mode 100644
index 0000000..413565b
--- /dev/null
+++ b/com32/lua/doc/syslinux.asc
@@ -0,0 +1,216 @@
+Syslinux LUA User Guide
+=======================
+Marcel Ritter <Marcel.Ritter at rrze.uni-erlangen.de>
+
+Modules
+-------
+
+SYSLINUX
+~~~~~~~~
+
+.syslinux.sleep(ms)
+
+Sleep for +ms+ milliseconds
+
+.run_command(command)
+
+Execute syslinux command line +command+.
+
+_Example_:
+......................................................
+	syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw")
+......................................................
+
+.run_default()
+
+FIXME
+
+.local_boot()
+
+FIXME
+
+.final_cleanup()
+
+FIXME
+
+.boot_linux(kernel, cmdline, [mem_limit], [videomode])
+
+FIXME
+
+.run_kernel_image(kernel, cmdline, ipappend_flags, type)
+
+FIXME
+
+.loadfile(filname)
+
+Load file +filename+ (via TFTP)
+
+.filesize(file)
+
+Return size of +file+ (loaded by loadfile())
+
+.filename(file)
+
+Return name of +file+ (loaded by loadfile())
+
+.in itramfs_init()
+
+Return empty initramfs object
+
+.initramfs_load_archive(initramfs, filename)
+
+Load contents of +filename+ into +initramfs+. Initialize
++initramfs+ with initramfs_init() before use.
+
+.initramfs_add_file(initramfs, file)
+
+Adds +file+ to +initramfs+. +initramfs+ needs to be
+initialized, +file+ has been loaded by loadfile().
+
+_Example_:
+......................................................
+	-- get nice output
+	printf = function(s,...)
+	           return io.write(s:format(...))
+	         end -- function
+	
+	kernel = syslinux.loadfile("/SuSE-11.1/x86_64/linux")
+	
+	printf("Filename/size: %s %d\n", syslinux.filename(kernel), syslinux.filesize(kernel))
+	
+	initrd = syslinux.loadfile("/SuSE-11.1/x86_64/initrd")
+	
+	printf("Filename/size: %s %d\n", syslinux.filename(initrd), syslinux.filesize(initrd))
+	
+	initrd = syslinux.initramfs_init()
+	syslinux.initramfs_load_archive(initrd, "/SuSE-11.1/x86_64/initrd");
+	
+	syslinux.boot_it(kernel, initrd, "init=/bin/bash")
+	
+	syslinux.sleep(20000)
+	
+......................................................
+
+
+
+DMI
+~~~
+
+.dmi_supported()
+
+Returns +true+ if DMI is supported on machine, +false+ otherwise.
+
+.dmi_gettable()
+
+Returns a list if key-value pairs. The key is one of the DMI property strings:
+FIXME list
+
+_Example_:
+......................................................
+	if (dmi.supported()) then
+	
+	  dmitable = dmi.gettable()
+	
+	  for k,v in pairs(dmitable) do
+	    print(k, v)
+	  end
+	
+	  print(dmitable["system.manufacturer"])
+	  print(dmitable["system.product_name"])
+	  print(dmitable["bios.bios_revision"])
+	
+	  if ( string.match(dmitable["system.product_name"], "ESPRIMO P7935") ) then
+	    print("Matches")
+	    syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw")
+	  else
+	    print("Does not match")
+	    syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw")
+	  end
+	
+	end
+
+......................................................
+
+
+PCI
+~~~
+
+.pci_getinfo()
+
+.pci_getidlist()
+
+
+VESA
+~~~~
+
+.getmodes()
+
+Return list of available VESA modes.
+
+_Example_:
+......................................................
+	-- get nice output
+	printf = function(s,...)
+	           return io.write(s:format(...))
+	         end
+	
+	-- list available vesa modes
+	-- only one supported right now, not of much use
+	modes = vesa.getmodes()
+	
+	for mind,mode in pairs(modes) do
+	   printf("%04x: %dx%dx%d\n", mode['mode'], mode['hres'], mode['vres'], mode['bpp'])
+	end
+......................................................
+
+
+.setmode()
+
+Set (only currently supported) VESA mode.
+
+.load_background(filename)
+
+Load +filename+ from TFTP, and use it as background image.
+
+_Example_:
+......................................................
+	-- get nice output
+	printf = function(s,...)
+	           return io.write(s:format(...))
+	         end
+	
+	-- lets go to graphics land
+	vesa.setmode()
+	
+	printf("Hello World! - VESA mode")
+	
+	-- some text to display "typing style"
+	textline=[[
+	From syslinux GSOC 2009 home page:
+	
+	Finish the Lua engine
+	
+	We already have a Lua interpreter integrated with the Syslinux build. However, right now it is not very useful. We need to create a set of bindings to the Syslinux functionality, and have an array of documentation and examples so users can use them.
+	
+	This is not a documentation project, but the documentation deliverable will be particularly important for this one, since the intended target is system administrators, not developers.
+	]]
+	
+	
+	-- do display loop
+	-- keep in mind: background change will not erase text!
+	while ( true ) do
+	
+	vesa.load_background("/background1.jpg")
+	
+	syslinux.sleep(1000)
+	
+	for i = 1, #textline do
+	    local c = textline:sub(i,i)
+	    printf("%s", c)
+	    syslinux.sleep(200)
+	end
+	
+	syslinux.sleep(10000)
+
+......................................................
+



More information about the Syslinux-commits mailing list