search for: __com32

Displaying 20 results from an estimated 39 matches for "__com32".

2013 Feb 06
1
Syslinux-5.01 cmd.c32 broken: __com32 undefined
Rather than acting like a typical C program using argc/argv, cmd.c32 uses __com32.cs_cmdline to retrieve what's passed to it. meminfo.c32 uses __intcall() which in the library calls __com32.cs_intcall(). Is __com32 only exposed for library functions or is there something else missing in here? Should accessing __com32.cs_cmdline be abstracted via a function call for protec...
2003 Sep 15
2
Can not use read file SYSLINUX API call
...use open file and read file SYSLINUX API. But it always make my PC104 freeze. My snip code : ================================================ int __start(void) { int ax,cx,dx,es,si,di,t; com32sys_t inreg,outreg; memset(&inreg, 0, sizeof inreg); memset(&outreg, 0, sizeof outreg); strcopy(__com32.cs_bounce, "test.txt"); inreg.eax.w[0] = 0x0006; // Open file inreg.esi.w[0] = OFFS(__com32.cs_bounce); inreg.es = SEG(__com32.cs_bounce); __com32.cs_intcall(0x22, &inreg, &outreg); si = outreg.esi.w[0]; cx = outreg.ecx.w[0]; ax = outreg.eax.w[0]; if ((ax % cx) == 0) t = ax / cx...
2007 Jan 25
5
Custom com32
Hi all I've written a basic COM32 module that checks (using the DMI example code) the product and BIOS and if the BIOS is not at the required level, is supposed to exit and boot using a DOS floppy image to flash the BIOS. The problem is that I can't work out how to call the DOS floppy image. Looking at the website, I see "Run Command" AX=0003H via int 22. The image name will
2012 Jun 26
2
[GIT PULL] elflink bug fixes
...le in the git repository at: git://git.zytor.com/users/mfleming/syslinux.git elflink Andre Ericson (1): ldlinux: fixes bug that happens when using fullpath for a COM32 module Matt Fleming (10): module: Actually use last component of DT_NEEDED pathname Delete all references to __com32.cs_bounce pxechn: Fix merge botch s/pxe_dns/pxe_dns_resolv/ com32: Add missing DHCP pack/unpack files elflink: Fix compiler warning fs: Add .copy_super to struct fs_ops com32: Per-object file LDFLAGS Revert "pxe: resolve names via DNS from protected-mode cod...
2008 Mar 25
3
Com32 api problem !
...unsigned long cylinders,heads,sectors; unsigned long long int total; unsigned short bytes; } disk; void ExtDiskInfo(int n) { printf("ExtDiskInfo entry.\n"); com32sys_t regs; memset(&regs,0,sizeof(regs)); regs.eax.b[1] = 0x48; regs.edx.b[0] = 0x80 + n; regs.ds = SEG(__com32.cs_bounce); regs.esi.w[0] = OFFS(__com32.cs_bounce); __intcall(0x13,&regs,&regs); if (regs.eax.b[1] == 0) { memcpy(&disk,__com32.cs_bounce,sizeof(struct params)); size = disk.total * disk.bytes; printf("Total hard disk size : %lld Mb (%lld sectors)\n",siz...
2007 Jan 06
6
PXE stack access via com32
...number ES:DI PXE data buffer Output: AX PXE return status code or, in com32 terms (the PXE call argument struct has been copied into the bounce buffer and the buffer field of the PXE call argument struct is setup to point into the bounce buffer as well): inputRegs.es = SEG(__com32.cs_bounce); inputRegs.edi.w[0] = OFFS(__com32.cs_bounce); inputRegs.eax.w[0] = 0x0009; /* call PXE stack */ inputRegs.ebx.w[0] = 0x0071; /* PXENV_GET_CACHED_INFO opcode */ __intcall(0x22, &inputRegs, &outputRegs); However, when setup this way, 'outputRegs.eax.w[0]&...
2009 Feb 11
1
[PATCH 1/1] COM32 API: Add functions for directory use
...; +#include <string.h> +#include <unistd.h> +#include <fcntl.h> + +int closedir(DIR *dir) +{ + int rv; + com32sys_t regs; + if (dir == NULL) { + rv = 0; + } else { + memset(&regs, 0, sizeof regs); /* ?Needed? */ + regs.eax.w[0] = 0x0022; + regs.esi.w[0] = dir->dd_fd; + __com32.cs_intcall(0x22, &regs, &regs); + free(dir); /* garbage collection? */ + rv = 0; + } + return rv; +} diff --git a/com32/lib/fdopendir.c b/com32/lib/fdopendir.c new file mode 100644 index 0000000..83a7ac6 --- /dev/null +++ b/com32/lib/fdopendir.c @@ -0,0 +1,13 @@ +/* + * fdopendir.c + */ +...
2008 Dec 04
0
[PATCH 1/1] COM32: Add directory functions
...; +#include <string.h> +#include <unistd.h> +#include <fcntl.h> + +int closedir(DIR *dir) +{ + int rv; + com32sys_t regs; + if (dir == NULL) { + rv = 0; + } else { + memset(&regs, 0, sizeof regs); /* ?Needed? */ + regs.eax.w[0] = 0x0021; + regs.esi.w[0] = dir->dd_fd; + __com32.cs_intcall(0x22, &regs, &regs); + free(dir); /* garbage collection? */ + rv = 0; + } + return rv; +} diff --git a/com32/lib/fdopendir.c b/com32/lib/fdopendir.c new file mode 100644 index 0000000..83a7ac6 --- /dev/null +++ b/com32/lib/fdopendir.c @@ -0,0 +1,13 @@ +/* + * fdopendir.c + */ +...
2008 Jul 16
2
[PATCH 1/2] chain.c32: fix bounce buffer handling
...com32/modules/chain.c index e6409b4..9ca118c 100644 --- a/com32/modules/chain.c +++ b/com32/modules/chain.c @@ -168,12 +168,13 @@ struct ebios_dapa { uint16_t off; uint16_t seg; uint64_t lba; -} *dapa; +}; static void *read_sector(unsigned int lba) { com32sys_t inreg; - void *buf = __com32.cs_bounce; + struct ebios_dapa *dapa = __com32.cs_bounce; + void *buf = (char *)__com32.cs_bounce + SECTOR; void *data; memset(&inreg, 0, sizeof inreg); @@ -227,11 +228,13 @@ static void *read_sector(unsigned int lba) return data; } -static int write_sector(unsigned int lba, con...
2009 May 24
1
Sending UDP packets from comboot
...t(&args, 0, sizeof(args)); args.ip = inet_addr("255.255.255.255"); // inet_addr working here? args.gw = inet_addr("0.0.0.0"); args.src_port = 4711; args.dst_port = 4799; args.buffer_size = <some sizeof() code> args.buffer = <some stuff to put my data in> memcpy(__com32.cs_bounce, &args, sizeof(args); inputRegs.es = SEG(__com32.cs_bounce); inputRegs.edi.w[0] = OFFS(__com32.cs_bounce); inputRegs.eax.w[0] = 0x0009; /* call PXE stack */ inputRegs.ebx.w[0] = 0x0033; /* PXENV_UDP_WRITE opcode */ __intcall(0x22, &inputRegs, NULL); // code end Could anyone gi...
2009 Mar 05
1
[PATCH 3/5] COM32: Improve opendir() to deal with no '/' at end of string
...wdir; com32sys_t regs; + char *tpath; + int pathlen; newdir = NULL; + pathlen = strlen(pathname); + if (pathname[pathlen-1] != '/') { + tpath = calloc(1, pathlen + 2); + strcpy(tpath, pathname); + strcpy(tpath + pathlen, "/"); + } else { + tpath = pathname; + } - strlcpy(__com32.cs_bounce, pathname, __com32.cs_bounce_size); + strlcpy(__com32.cs_bounce, tpath, __com32.cs_bounce_size); regs.eax.w[0] = 0x0020; regs.esi.w[0] = OFFS(__com32.cs_bounce); @@ -34,6 +45,10 @@ DIR *opendir(const char *pathname) newdir->dd_fd = regs.esi.w[0]; newdir->dd_sect = regs.ea...
2010 Apr 27
2
gpllib write_sectors() patch
...e so they should be supplied in the driveinfo struct (for both read and write). /** * write_sectors - write several sectors from disk @@ -37,9 +55,14 @@ int write_sectors(const struct driveinfo *drive_info, const unsigned int lba, { com32sys_t inreg, outreg; struct ebios_dapa *dapa = __com32.cs_bounce; - void *buf = (char *)__com32.cs_bounce + size; + void *buf = (char *)__com32.cs_bounce + size*SECTOR; - memcpy(buf, data, size); + if (get_drive_parameters(drive_info) == -1) { + printf("ERR: Can't get drive params!\n"); + return -1; + } + + me...
2003 Apr 21
3
COM32 Question
Does the COMBOOT stuff with 2.04 work correctly with function calls? or does one need to write it as one huge function? If memory serves me correctly, there was some problem if hello.c was modified to include additional functions, in an earlier version. - Murali
2008 Jul 19
0
[PATCH] ethersel: use library functions
...if ( !filename ) - filename = get_config(); + filename = syslinux_config_file(); f = fopen(filename, "r"); if ( !f ) @@ -198,19 +189,6 @@ return list; } -static void __attribute__((noreturn)) -execute(const char *cmdline) -{ - static com32sys_t ireg; - - strcpy(__com32.cs_bounce, cmdline); - ireg.eax.w[0] = 0x0003; /* Run command */ - ireg.ebx.w[0] = OFFS(__com32.cs_bounce); - ireg.es = SEG(__com32.cs_bounce); - __intcall(0x22, &ireg, NULL); - exit(255); /* Shouldn't return */ -} - int main(int argc, char *argv[]) { struct match *list, *m...
2010 Jun 26
2
[PATCH] Fix COM32 chdir()
...- diff --git a/com32/lib/chdir.c b/com32/lib/chdir.c index 6a365f3..4bd4c84 100644 --- a/com32/lib/chdir.c +++ b/com32/lib/chdir.c @@ -8,10 +8,5 @@ int chdir(const char *path) { - /* Actually implement something here... */ - - (void)path; - - errno = ENOSYS; - return -1; + return __com32.cs_pm->chdir(path); }
2006 Mar 11
5
mboot.c32, weird e820 map on HP blade machine, possible memory corruption
...an someone think of anything? Another thing is, the e820 buffer should be zeroed out since some bios'es are buggy and dont overwrite the high doubleword of Length field of the AddrRangeDesc. This is seen on the Dell Poweredge1800's. So it should look like: while(((void *)(e820 + 1)) < __com32.cs_bounce + __com32.cs_bounce_size) { memset(e820, 0, sizeof(*e820)); e820->size = sizeof(*e820) - sizeof(e820->size); .... hope Tim, the maintainer can take care of this. -- Ram
2007 Feb 12
4
Read disk not working in 3.35+
...disk function which was launched in 3.35 isnt working. Did anyone test this on any hardware? I'm using it thru the com32 interface to read contents of the active partition of a USB boot key (syslinux). I did a sample test like: void scanAndPrint() { com32sys_t regs_in; char *sectorBuf = __com32.cs_bounce; int i; memset(sectorBuf, 0x0, 512); // XXX MARK 1 for (i=0; i< 10; i++) { int j; memset(&regs_in, 0, sizeof regs_in); regs_in.eax.l = 0x0019; regs_in.edx.l = i; // sector number regs_in.ecx.l = 1; // sector count regs_in.es = SEG(sect...
2009 Jul 27
1
[PATCH] mboot using module path
...syslinux-3.82/com32/lib/chdir.c??? 2009-07-27 11:11:34.000000000 -0700 @@ -5,9 +5,25 @@ ?#include <dirent.h> ?#include <stdio.h> ?#include <errno.h> +#include <com32.h> ?int chdir(const char *path) ?{ -??? errno = ENOSYS; -??? return -1; +??? com32sys_t regs; + +??? strlcpy(__com32.cs_bounce, path, __com32.cs_bounce_size); + +??? regs.eax.w[0] = 0x0025; +??? regs.esi.w[0] = OFFS(__com32.cs_bounce); +??? regs.es = SEG(__com32.cs_bounce); + +??? __com32.cs_intcall(0x22, &regs, &regs); + +??? if (!(regs.eflags.l & EFLAGS_CF)) { +??? ??? return -1; +??? } + +??? /* We...
2009 Mar 06
0
[PATCH 2/3] COM32 API: restructure DIR
...*dir) /* Don't do this as we won't be able to rewind. dir->dd_fd = regs.esi.w[0]; /* Shouldn't be needed? */ if ((!(regs.eflags.l & EFLAGS_CF)) && (regs.esi.w[0] != 0)) { - newde = calloc(1, sizeof(newde)); - if (newde != NULL) { - strcpy(newde->d_name, __com32.cs_bounce); - newde->d_mode = regs.edx.w[0]; - newde->d_type = (newde->d_mode & S_IFMT) >> 12; - newde->d_size = regs.eax.l; - newde->d_ino = regs.ebx.l; - dir->dd_stat = 1; - } else { - dir->dd_stat = -2; - errno = ENOMEM; - } + newde = dir...
2011 Mar 30
1
menu.c32 hangs
...ed. So I advanced start_console() to before parse_config(), and after a couple of trace, I reached syslinux/com32/lib/sys/open.c:open: I made such changes: printf("file: %s line: %d fd: %d fp: %p\n", __FILE__, __LINE__, fd, fp); printf("open: %p, open_file: %p\n", open, __com32.cs_pm->open_file); handle = __com32.cs_pm->open_file(pathname, &fp->i.fd); printf("file: %s line: %d\n", __FILE__, __LINE__); It turns out that, the first two printf() statement is executed, but the third one is not. The screen output is: file sys/open.c line: 65 fd...