* bios32_SDlookup * * Query the BIOS32 Service Directory for the service named in (ent), * returns nonzero if the lookup fails. The caller must fill in * (ent->ident), the remainder are populated on a successful lookup. */
| 165 | * (ent->ident), the remainder are populated on a successful lookup. |
| 166 | */ |
| 167 | int |
| 168 | bios32_SDlookup(struct bios32_SDentry *ent) |
| 169 | { |
| 170 | struct bios_regs args; |
| 171 | |
| 172 | if (bios32_SDCI == 0) |
| 173 | return (1); |
| 174 | |
| 175 | args.eax = ent->ident.id; /* set up arguments */ |
| 176 | args.ebx = args.ecx = args.edx = 0; |
| 177 | bios32(&args, bios32_SDCI, GSEL(GCODE_SEL, SEL_KPL)); |
| 178 | if ((args.eax & 0xff) == 0) { /* success? */ |
| 179 | ent->base = args.ebx; |
| 180 | ent->len = args.ecx; |
| 181 | ent->entry = args.edx; |
| 182 | ent->ventry = BIOS_PADDRTOVADDR(ent->base + ent->entry); |
| 183 | return (0); /* all OK */ |
| 184 | } |
| 185 | return (1); /* failed */ |
| 186 | } |
| 187 | |
| 188 | /* |
| 189 | * bios_sigsearch |