nora23169 wrote:
I want to create a small OS with bare metal CLI. What should I do?
That's a difficult question. First, have you searched around to see what's already been done in this area for the 6502? There are already several small OS type environments available. They include Dieter's CPM65, Rich Leary's DOS/65 and recently David Givens CP/M-65. Granted, all of these are based on CP/M and at least two of them use the CP/M filesystem layout. Another user here started porting Flex over to the 6502, which was a 6800 OS. You also have Fuzix, which is designed as a minimal Unix derived type of system. Yes, I'm glossing over these at a high level, just to let you know there are already options out there.
Perhaps you should define what you mean by a "small OS" and create a set of requirements for what that is. Beyond that, there needs to be some specific minimal hardware configuration that will be required to run it. Overall, a bit of a tall order, especially if you're not quite sure where to start.