17 #include <linux/edd.h>
19 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
42 char *mbrbuf_ptr, *mbrbuf_end;
47 sector_size = ei->
params.bytes_per_sector;
52 buf_base = (
ds() << 4) + (
u32)&_end;
53 mbr_base = (buf_base+sector_size-1) & ~(sector_size-1);
54 mbrbuf_ptr = _end + (mbr_base-
buf_base);
63 memset(mbrbuf_ptr, 0, sector_size);
64 if (read_mbr(devno, mbrbuf_ptr))
68 mbr_magic = *(
u16 *)&mbrbuf_ptr[510];
71 return mbr_magic == 0xAA55 ? 0 : -1;
74 static int get_edd_info(
u8 devno,
struct edd_info *ei)
125 #ifdef CONFIG_EDD_OFF
135 if (cmdline_find_option(
"edd", eddarg,
sizeof eddarg) > 0) {
136 if (!
strcmp(eddarg,
"skipmbr") || !
strcmp(eddarg,
"skip")) {
140 else if (!
strcmp(eddarg,
"off"))
142 else if (!
strcmp(eddarg,
"on"))
146 be_quiet = cmdline_find_option_bool(
"quiet");
159 printf(
"Probing EDD (edd=off to disable)... ");
166 if (!get_edd_info(devno, &ei)
168 memcpy(edp, &ei,
sizeof ei);
173 if (do_mbr && !read_mbr_sig(devno, &ei, mbrptr++))