Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hy guys
I have a little project i need help with. i want to add an authentication to my pc that will run before the boot options and before i can choose to enter bios(authentication means either password or certain key presses). now i have done some research and someone recomended me to study UEFI but it didn't help me much. i just want to know a language (assembly maybe?) and more important what format should it have and where to insert it.

thanks in advanced

edit: a lot of people think i want this script(let's call it that) to run before bios. this is wrong i want bios to run it(the script) before boot options appear so noone can acces any of my os.

i just want a simple solution like
(pseudocot don't know what language needed? C or assembly?!)
get input
if input != what expected
power off laptop

and then a simple modify to my bios so it will run this process before others..but i am losing hope that this thing that i considered so easy is even possible...
Posted
Updated 17-Nov-15 10:02am
v4
Comments
Richard Deeming 17-Nov-15 15:21pm    
No code runs before the BIOS. What you are trying to do is not possible.
Member 12147362 17-Nov-15 15:52pm    
i don't want to run it before bios i want bios to run a script for me before boot options appear...
Richard Deeming 17-Nov-15 15:56pm    
So you want to write your own BIOS?

I hope you only need to support a single chipset; otherwise, you'll have to write a different BIOS for each chipset you need to support.

And you should probably forget about UEFI - the secure boot loader won't run any code that's not signed with a trusted key.

To repeat what Sergey said: why? The only reason I can think of to do this would be if you were trying to write a low-level virus to lock people out of their own computers.
Member 12147362 17-Nov-15 16:06pm    
i want to lock people out of my laptop. one chipset, one bios. it's for security because os passwords can be cracked and i figured that if you can't run anything before authentication you can't do anything.

ps: no funny business(hacking, cracking) here, just for my onw security
ZurdoDev 17-Nov-15 16:23pm    
It'd be easier to buy a safe to store your laptop in than to write this code anyway. ;)

This little project is nowhere near as easy as you think it is.

First, you're going to be limited to ASM code. You're not going to have ANY libraries at all, so you have to write everything from scratch, including any encryption algorithms and key storage and management. If you think you need to go through this, you're not going to store the passwords in clear text in a disk sector somewhere.

You're going to have to research how partition tables work and how they let the BIOS know how to find the new boot code.

You also have to write an installer/uninstaller for this to move the O/S boot loader on disk out of the way so there's room for your code, and keep track of where you moved it and make sure there's room to do it. These are NOT file operations, they are disk sector operations.

Your code is also going to have to setup the environment to load the O/S boot loader and hand control over to it.

Now, what if you forget/fat finger the password? How are you going to recover from these situations? How are you going to verify the identity of the person to reset the password?


You're not going to find examples of doing this. This is something where you need to know, extremely well, what you're doing and how everything works.
 
Share this answer
 
Comments
Member 12147362 20-Nov-15 5:39am    
thank you i'll start learning assembly :)
Dave Kreskowiak 20-Nov-15 10:08am    
WHAT? Wow. Good Luck.

In the mean time, if security is that important on your machine, you might want to buy a commercial product while you work on your skills. It's going to be a long time before you can get this project to work.
You could start here: http://x86asm.net/articles/uefi-programming-first-steps[^], but I have no idea why would you ever need it — please see my comment to the question.

—SA
 
Share this answer
 
i found this: Bios Interrupt Service Routine (ISR). any of you guys know something about it and if it might work this way?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900